Improve output messages a bit
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 2 Jul 2014 18:27:25 +0000 (14:27 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 2 Jul 2014 18:27:25 +0000 (14:27 -0400)
crunch_scripts/run-command

index 9d4f3618931329e8897d9cfd8c122a351d039618..6335523a74a01b8e22a4b3021a971d9732f640d1 100755 (executable)
@@ -50,24 +50,24 @@ try:
         stdoutname = subst.do_substitution(p, p["stdout"])
         stdoutfile = open(stdoutname, "wb")
 
-    print("run-command {}{}".format(' '.join(cmd), (" > " + stdoutname) if stdoutname != None else ""))
+    print("run-command: {}{}".format(' '.join(cmd), (" > " + stdoutname) if stdoutname != None else ""))
 
     rcode = subprocess.call(cmd, stdout=stdoutfile)
 
-    print("run-command completed with exit code %i" % rcode)
+    print("run-command: completed with exit code %i" % rcode)
 
 except Exception as e:
-    print("run-command exception: {}".format(e))
+    print("run-command: caught exception: {}".format(e))
 
 finally:
     for l in links:
         os.unlink(l)
 
-    print("run-command output:")
+    print("run-command: the follow output files will be saved to keep:")
 
-    subprocess.call(["find", ".", "-type", "f", "-printf", "run-command %12.12s %h/%f\\n"])
+    subprocess.call(["find", ".", "-type", "f", "-printf", "run-command: %12.12s %h/%f\\n"])
 
-    print("run-command writing to keep")
+    print("run-command: start writing output to keep")
 
     out = arvados.CollectionWriter()
     out.write_directory_tree(".", max_manifest_depth=0)
@@ -83,8 +83,8 @@ if rcode == 0:
     os.chdir("..")
     shutil.rmtree("tmpdir")
     shutil.rmtree("output")
-    print("run-command success")
+    print("run-command: success")
 else:
-    print("run-command failed")
+    print("run-command: failed")
 
 sys.exit(rcode)