4800: run-command calls sys.exit() with an integer.
authorBrett Smith <brett@curoverse.com>
Thu, 18 Dec 2014 16:04:23 +0000 (11:04 -0500)
committerBrett Smith <brett@curoverse.com>
Thu, 18 Dec 2014 16:04:59 +0000 (11:04 -0500)
Closes #4800.

crunch_scripts/run-command

index 13ae918895d6192553107ae00273e247c6eb4c34..c07debd787eecfc6696c5d614d69c013f8028dd7 100755 (executable)
@@ -434,8 +434,8 @@ if "task.vwd" in taskp:
 else:
     outcollection = robust_put.upload(outdir, logger)
 
-# Success if no non-zero return codes
-success = any(rcode) and not any([status != 0 for status in rcode.values()])
+# Success if we ran any subprocess, and they all exited 0.
+success = rcode and all(status == 0 for status in rcode.itervalues())
 
 api.job_tasks().update(uuid=arvados.current_task()['uuid'],
                                      body={
@@ -444,4 +444,4 @@ api.job_tasks().update(uuid=arvados.current_task()['uuid'],
                                          'progress':1.0
                                      }).execute()
 
-sys.exit(rcode)
+sys.exit(0 if success else 1)