diff options
author | Mike Bonnet <mikeb@redhat.com> | 2007-12-11 18:54:10 -0500 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2007-12-11 18:04:05 -0600 |
commit | bd5d08919539538c0bfead439fd8e3a33f3b01b3 (patch) | |
tree | 04872ede3c1709153a4df4e7abc1ea4b116cac55 /py/mock/util.py | |
parent | c4edf71309f230955998fd2922d6045068b31eab (diff) | |
download | mock-bd5d08919539538c0bfead439fd8e3a33f3b01b3.tar.gz mock-bd5d08919539538c0bfead439fd8e3a33f3b01b3.tar.xz mock-bd5d08919539538c0bfead439fd8e3a33f3b01b3.zip |
- make "mock --chroot" non-interactive - set the exit code of "mock --chroot" to the exit code of the process run in the chroot - log the output of the process to root.log
Signed-off-by: Michael E Brown <michael_e_brown@dell.com>
Diffstat (limited to 'py/mock/util.py')
-rw-r--r-- | py/mock/util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/mock/util.py b/py/mock/util.py index f2ddec2..bfaa03a 100644 --- a/py/mock/util.py +++ b/py/mock/util.py @@ -274,11 +274,11 @@ def do(command, chrootPath=None, timeout=0, raiseExc=True, returnOutput=0, uidMa signal.signal(signal.SIGALRM, oldhandler) # mask and return just return value, plus child output - if raiseExc and os.WEXITSTATUS(ret): + if raiseExc and ((os.WIFEXITED(ret) and os.WEXITSTATUS(ret)) or os.WIFSIGNALED(ret)): if returnOutput: - raise mock.exception.Error, "Command failed: \n # %s\n%s" % (command, output) + raise mock.exception.Error, ("Command failed: \n # %s\n%s" % (command, output), ret) else: - raise mock.exception.Error, "Command failed. See logs for output.\n # %s" % command + raise mock.exception.Error, ("Command failed. See logs for output.\n # %s" % (command,), ret) return output |