From b1b2654ddbbb1dd6d5fdb2ff8ea6044fe28d99bf Mon Sep 17 00:00:00 2001 From: John Dennis Date: Thu, 19 Nov 2009 12:14:30 -0500 Subject: along with stdout, stderr also log the initial command Signed-off-by: John Dennis 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. --- ipapython/ipautil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ipapython') diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index 47b651c1..10668793 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -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)) -- cgit