mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
dbb5721e7c
commit
b1b2654ddb
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user