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

View File

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