- correctly capture errors from subprocess

This commit is contained in:
Jesse Keating 2007-03-13 22:16:39 -04:00 committed by Jesse Keating
parent 1c45ac7daf
commit 876cb98ba7
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
* Tue Mar 13 2007 Jesse Keating <jkeating@redhat.com>
- log the rpm2cpio stuff for release notes
- correctly capture errors from subprocess
* Wed Mar 07 2007 Jesse Keating <jkeating@redhat.com>
- Call createrepo ourselves for the tree, not buildinstall's job

View File

@ -69,12 +69,12 @@ class Pungi:
log.info("Running %s" % ' '.join(command))
try:
(out, err) = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error).communicate()
except:
p1 = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error)
(out, err) = p1.communicate()
if p1.returncode != 0:
log.error("Got an error from %s" % command[0])
log.error(err)
raise
raise OSError, "Got an error from %s" % command[0]
log.info(out)