Author: tmckay
Date: 2011-02-25 14:24:52 +0000 (Fri, 25 Feb 2011)
New Revision: 4559
Modified:
trunk/cumin/bin/cumin
Log:
Tweak master.log output for --init-only.
Indent content from subprocess, record any stderr output on success, too, not just
failure.
Modified: trunk/cumin/bin/cumin
===================================================================
--- trunk/cumin/bin/cumin 2011-02-24 20:52:13 UTC (rev 4558)
+++ trunk/cumin/bin/cumin 2011-02-25 14:24:52 UTC (rev 4559)
@@ -125,12 +125,17 @@
arg = [app[PROGRAM], "--init-only", "--section=" +
app[SECTION]]
app[PROCESS] = subprocess.Popen(arg, stderr=subprocess.PIPE)
errors = app[PROCESS].communicate()[1]
- if app[PROCESS].wait() != 0:
- msg = "Subprocess failed:" + "".join([" "+x
for x in arg])
- if len(errors) > 0:
- msg += "\n" + errors
- log.error(msg)
- return 1
+ # Indent any output we received
+ if len(errors) > 0:
+ errors = "\n " + errors.replace("\n","\n
")
+ result = app[PROCESS].wait()
+ if len(errors) > 0 or result != 0:
+ msg = "".join([" "+x for x in arg]) + errors
+ if result != 0:
+ log.error("Subprocess failed:" + msg)
+ else:
+ log.info("Subprocess output:" + msg)
+ return result
else:
# Launch and babysit
try:
Show replies by date