along with stdout, stderr also log the initial command

Signed-off-by: John Dennis <jdennis@redhat.com>

along with stdout,stderr also log the initial command

This implements better logging of external commands. Formerly we were
just outputting stdout and stderr without labeling which was which. We
also omitted the initial command and it's arguments. This made it
difficult when reviewing the logs to know what the command was and
what was stdout vs. stderr. This patch fixes that.
This commit is contained in:
John Dennis 2009-11-19 12:14:30 -05:00 committed by Rob Crittenden
parent dbb5721e7c
commit b1b2654ddb

View File

@ -97,8 +97,9 @@ def run(args, stdin=None):
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
stdout,stderr = p.communicate()
logging.info(stdout)
logging.info(stderr)
logging.info('args=%s' % ' '.join(args))
logging.info('stdout=%s' % stdout)
logging.info('stderr=%s' % stderr)
if p.returncode != 0:
raise CalledProcessError(p.returncode, ' '.join(args))