diff --git a/Changelog b/Changelog index 0430b150..da8d3197 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ * Tue Mar 13 2007 Jesse Keating - log the rpm2cpio stuff for release notes +- correctly capture errors from subprocess * Wed Mar 07 2007 Jesse Keating - Call createrepo ourselves for the tree, not buildinstall's job diff --git a/pypungi/pungi.py b/pypungi/pungi.py index 1b66a67c..22dcd369 100755 --- a/pypungi/pungi.py +++ b/pypungi/pungi.py @@ -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)