Set success/failed flag explicitly based on return code.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 1 Jul 2014 16:54:46 +0000 (12:54 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 1 Jul 2014 16:54:46 +0000 (12:54 -0400)
crunch_scripts/run-command

index a0c7cfe77cf35e63278e885e6291de744aff0cd1..aa50cde4d7d6d6ab3931101992e55a67ba6f9f74 100755 (executable)
@@ -56,7 +56,6 @@ try:
 
 except Exception as e:
     print("Caught exception {}".format(e))
-    rcode = 1
 
 finally:
     for l in links:
@@ -64,7 +63,13 @@ finally:
 
     out = arvados.CollectionWriter()
     out.write_directory_tree(".", max_manifest_depth=0)
-    arvados.current_task().set_output(out.finish())
+    outuuid = out.finish()
+    arvados.api('v1').job_tasks().update(uuid=arvados.current_task()['uuid'],
+                                         body={
+                                             'output':outuuid,
+                                             'success': (rcode == 0),
+                                             'progress':1.0
+                                         }).execute()
 
 if rcode == 0:
     os.chdir("..")