summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-19 11:56:45 -0700
committerJesse Keating <jkeating@redhat.com>2011-02-08 14:33:48 -0700
commitec8c530a7004f426abc15b1088de7e0dc315d0e7 (patch)
treef30a4f0ed60933f729f3013a6a29fe9cd4747ccb
parent32e4a38579250756718659134766b20d6c72fb5a (diff)
downloadfedora-packager-ec8c530a7004f426abc15b1088de7e0dc315d0e7.zip
fedora-packager-ec8c530a7004f426abc15b1088de7e0dc315d0e7.tar.gz
fedora-packager-ec8c530a7004f426abc15b1088de7e0dc315d0e7.tar.xz
Exit with an error when appropriate
When dealing with the pipe stuff, we need to catch if the first command exits with an error, because that error won't carry through to the piped command. Fixes RHBZ:634888
-rw-r--r--src/pyfedpkg/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index f913774..96f8fc9 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -167,6 +167,9 @@ def _run_command(cmd, shell=False, env=None, pipe=[], cwd=None):
stdin=proc.stdout,
shell=shell,
cwd=cwd)
+ (output, err) = proc.communicate()
+ if proc.returncode:
+ raise FedpkgError('Non zero exit')
else:
subprocess.check_call(command, env=environ, stdout=sys.stdout,
stderr=sys.stderr, shell=shell,