Merge branch 'master' into 3153-auto-setup-user
[arvados.git] / crunch_scripts / run-command
index 54f683877bedd1823569ffcfc0815512560d4bc4..c624e3cadf7ec7fdaad169f04ffb8f34f8bcdd9f 100755 (executable)
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 
+import logging
+logging.basicConfig(level=logging.INFO, format="run-command: %(message)s")
+
 import arvados
 import re
 import os
@@ -15,12 +18,10 @@ import copy
 import traceback
 import pprint
 import multiprocessing
-import logging
 import crunchutil.robust_put as robust_put
 import crunchutil.vwd as vwd
 
 os.umask(0077)
-logging.basicConfig(format="run-command: %(message)s")
 
 t = arvados.current_task().tmpdir
 
@@ -164,7 +165,7 @@ try:
         stdoutname = subst.do_substitution(taskp, taskp["task.stdout"])
         stdoutfile = open(stdoutname, "wb")
 
-    logging.info("{}{}{}".format(' '.join(cmd), (" < " + stdinname) if stdinname is not None else ""), (" > " + stdoutname) if stdoutname is not None else ""))
+    logging.info("{}{}{}".format(' '.join(cmd), (" < " + stdinname) if stdinname is not None else "", (" > " + stdoutname) if stdoutname is not None else ""))
 
 except Exception as e:
     logging.exception("caught exception")