Return the output from failed commands in CalledProcessError
Some callers expect CalledProcessError.output to have the output, so pass up the stdout + stderr output. This means failed runcmd template commands will log to program.log and lorax.log
This commit is contained in:
parent
b23bef069a
commit
522ec34360
@ -195,7 +195,8 @@ def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None, log_ou
|
||||
program_log.debug("Return code: %d", proc.returncode)
|
||||
|
||||
if proc.returncode and raise_err:
|
||||
raise subprocess.CalledProcessError(proc.returncode, argv)
|
||||
output = output_string or "" + err_string or ""
|
||||
raise subprocess.CalledProcessError(proc.returncode, argv, output)
|
||||
|
||||
return (proc.returncode, output_string)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user