From: Serge Rehbinder Date: Tue, 15 Nov 2016 14:21:49 +0000 (+0100) Subject: Jobs returns 1 if one or more jobs failed X-Git-Tag: 5.0.0a1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0a5db8a9cf364ca82d300ce4d8d9e87836bbe651;p=tools%2Fsat.git Jobs returns 1 if one or more jobs failed --- diff --git a/commands/jobs.py b/commands/jobs.py index 288da40..258f530 100644 --- a/commands/jobs.py +++ b/commands/jobs.py @@ -1667,7 +1667,9 @@ def run(args, runner, logger): logger.write("\n\n%s\n\n" % (src.printcolors.printcWarning(_("Forced interruption"))), 1) finally: + res = 0 if interruped: + res = 1 msg = _("Killing the running jobs and trying" " to get the corresponding logs\n") logger.write(src.printcolors.printcWarning(msg)) @@ -1675,11 +1677,14 @@ def run(args, runner, logger): # find the potential not finished jobs and kill them for jb in today_jobs.ljobs: if not jb.has_finished(): + res = 1 try: jb.kill_remote_process() except Exception as e: msg = _("Failed to kill job %s: %s\n" % (jb.name, e)) logger.write(src.printcolors.printcWarning(msg)) + if jb.res_job != "0": + res = 1 if interruped: if today_jobs.gui: today_jobs.gui.last_update(_("Forced interruption")) @@ -1688,3 +1693,4 @@ def run(args, runner, logger): today_jobs.gui.last_update() # Output the results today_jobs.write_all_results() + return res \ No newline at end of file