From df74993d060f558c849f8feb62def958bc192eba Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Fri, 19 Oct 2007 01:31:08 -0500 Subject: better message for failed command when output disabled. --- src/py-libs/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/py-libs/util.py b/src/py-libs/util.py index f2d13f6..f4f189b 100644 --- a/src/py-libs/util.py +++ b/src/py-libs/util.py @@ -223,7 +223,10 @@ def do(command, chrootPath=None, timeout=0, raiseExc=True, returnOutput=0, *args # mask and return just return value, plus child output if raiseExc and os.WEXITSTATUS(ret): - raise mock.exception.Error, "Command(%s) failed. Output: %s" % (command, output) + if returnOutput: + raise mock.exception.Error, "Command(%s) failed. Output: %s" % (command, output) + else: + raise mock.exception.Error, "Command(%s) failed. See logs for output." % command return output -- cgit