[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-689-gbf31baf
Andreas Beckmann
debian at abeckmann.de
Sun Jun 10 11:10:16 UTC 2012
The following commit has been merged in the piatti branch:
commit 14a1bd324202839decb73ae519bc27f610c77b59
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Mon Jun 4 21:58:49 2012 +0200
p: run(): append termination notice to command output
The failure of a command is displayed *before* the command output
is dumped, so just looking at the tail of the logfile was hiding
the reason. Add some information to the output itself.
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piuparts.py b/piuparts.py
index bb41e36..86c6fd1 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -432,12 +432,15 @@ def run(command, ignore_errors=False, timeout=0):
excessive_output = True
alarm(0)
kill_subprocess(p, "excessive output")
+ output += "\n\n***** Command was terminated after exceeding output limit (%.2f MB) *****\n" \
+ % (settings.max_command_output_size / 1024. / 1024.)
break
if not excessive_output:
output += p.stdout.read(settings.max_command_output_size)
alarm(0)
except Alarm:
kill_subprocess(p, "excessive runtime")
+ output += "\n\n***** Command was terminated after exceeding runtime limit (%s s) *****\n" % timeout
devnull.close()
if output:
@@ -451,8 +454,6 @@ def run(command, ignore_errors=False, timeout=0):
else:
logging.error("Command failed (status=%d): %s\n%s" %
(p.returncode, repr(command), indent_string(output)))
- if excessive_output:
- logging.error("Command was terminated while producing excessive output")
panic()
return p.returncode, output
--
piuparts git repository
More information about the Piuparts-commits
mailing list