diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-01-05 17:28:21 -0800 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-01-05 17:28:21 -0800 |
commit | 0c6baceffd10e161c4f4e468bed5c00a256fbc07 (patch) | |
tree | 63d91e0fc62df4d8a3ad9d8af0df11a71f15f525 /src | |
parent | 945d365a6d215044de112fa28234f0786ce7500d (diff) | |
download | fedora-packager-0c6baceffd10e161c4f4e468bed5c00a256fbc07.tar.gz fedora-packager-0c6baceffd10e161c4f4e468bed5c00a256fbc07.tar.xz fedora-packager-0c6baceffd10e161c4f4e468bed5c00a256fbc07.zip |
Use logging instead of prints or returning output
Diffstat (limited to 'src')
-rw-r--r-- | src/fedpkg/__init__.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/fedpkg/__init__.py b/src/fedpkg/__init__.py index 1baa814..3ed9c5f 100644 --- a/src/fedpkg/__init__.py +++ b/src/fedpkg/__init__.py @@ -406,7 +406,7 @@ class PackageModule: optionally for a specific arch - Returns the output""" + Logs the output and returns the returncode from the prep call""" # Get the sources self.sources() @@ -417,18 +417,15 @@ class PackageModule: cmd.extend(['--target', arch]) cmd.extend(['--nodeps', '-bp', os.path.join(self.path, self.spec)]) # Run the command and capture output + log.debug('Running: %s' % ' '.join(cmd)) try: proc = subprocess.Popen(' '.join(cmd), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=True) output = proc.communicate() except OSError, e: raise FedpkgError(e) - # See if we exited cleanly - if proc.returncode: - raise FedpkgError('%s returned %s: %s' % - (subprocess.list2cmdline(cmd), - proc.returncode, output[0])) - return output[0] + log.info(output[0]) + return(proc.returncode) def sources(self, outdir=None): """Download source files""" |