Merge "Stop logging STDOUT and STDERR on every shell out"

This commit is contained in:
Jenkins 2015-08-30 00:03:41 +00:00 committed by Gerrit Code Review
commit 658897897d
1 changed files with 7 additions and 6 deletions

View File

@ -132,19 +132,20 @@ def execute(cmd, process_input=None, addl_env=None,
except UnicodeError:
pass
m = _("\nCommand: {cmd}\nExit code: {code}\nStdin: {stdin}\n"
"Stdout: {stdout}\nStderr: {stderr}").format(
m = _("\nCommand: {cmd}\nExit code: {code}\n").format(
cmd=cmd,
code=returncode,
stdin=process_input or '',
stdout=_stdout,
stderr=_stderr)
code=returncode)
extra_ok_codes = extra_ok_codes or []
if returncode and returncode in extra_ok_codes:
returncode = None
if returncode and log_fail_as_error:
m += ("Stdin: {stdin}\n"
"Stdout: {stdout}\nStderr: {stderr}").format(
stdin=process_input or '',
stdout=_stdout,
stderr=_stderr)
LOG.error(m)
else:
LOG.debug(m)