From 0c6baceffd10e161c4f4e468bed5c00a256fbc07 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 5 Jan 2010 17:28:21 -0800 Subject: Use logging instead of prints or returning output --- src/fedpkg/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') 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""" -- cgit