diff options
author | John Dennis <jdennis@redhat.com> | 2009-11-19 12:14:30 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-11-23 16:31:02 -0500 |
commit | b1b2654ddbbb1dd6d5fdb2ff8ea6044fe28d99bf (patch) | |
tree | ede8dc06e671ef9318c7a8013856eb85a186a9d0 /ipapython | |
parent | dbb5721e7c1660488bf028b0a2439f792b1b93e9 (diff) | |
download | freeipa-b1b2654ddbbb1dd6d5fdb2ff8ea6044fe28d99bf.tar.gz freeipa-b1b2654ddbbb1dd6d5fdb2ff8ea6044fe28d99bf.tar.xz freeipa-b1b2654ddbbb1dd6d5fdb2ff8ea6044fe28d99bf.zip |
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.
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/ipautil.py | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |