Log stdout/stderr during error

Paunch does not currently show stdout/stderr from the docker cmd when an
error happens. Without this output, there is no way to tell what
actually caused the container command to fail.

Log the output with LOG.error if we get an unexpected return code so
that the actual error is displayed to the user.

Change-Id: I951cdf0cb2bfd87a22a239ff7522ab5bba9d6eb6
Closes-Bug: #1707948
This commit is contained in:
James Slagle 2017-08-01 11:42:20 -04:00
parent efdcacc0de
commit 64df79c70d
1 changed files with 4 additions and 0 deletions

View File

@ -67,9 +67,13 @@ class ComposeV1Builder(object):
if returncode not in exit_codes:
LOG.error("Error running %s. [%s]\n" % (cmd, returncode))
LOG.error("stdout: %s" % cmd_stdout)
LOG.error("stderr: %s" % cmd_stderr)
deploy_status_code = returncode
else:
LOG.debug('Completed $ %s' % ' '.join(cmd))
LOG.info("stdout: %s" % cmd_stdout)
LOG.info("stderr: %s" % cmd_stderr)
return stdout, stderr, deploy_status_code
def delete_missing_and_updated(self):