Nextdoor / ndscheduler

A flexible python library for building your own cron-like system, with REST APIs and a Web UI.
BSD 2-Clause "Simplified" License
1.09k stars 201 forks source link

Validate return status for shell scripts #40

Closed nsoria1 closed 5 years ago

nsoria1 commented 6 years ago

Hi team, thanks for sharing this tool.

I would like to know where should I modify the python code to evaluate the status code from shell scripts to make it fail if it is different than zero.

Thanks! Nicolas.

sabw8217 commented 5 years ago

Somewhere in the run method of the Job subclass you are using. For example, in the sample jobs, you would need to do something with the return value of the call function: https://github.com/Nextdoor/ndscheduler/blob/master/simple_scheduler/jobs/shell_job.py#L24