don't log cli output on success
we only should log cli output on failure, not success. So just
leave it to the exception to log it. This helps reduce the needless
spam inside the tempest log.
Change-Id: I1623694d7321e679e8438eba3e6b1ad58fc6e855
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index 932b151..84884a2 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -115,25 +115,19 @@
cmd = ' '.join([os.path.join(CONF.cli.cli_dir, cmd),
flags, action, params])
LOG.info("running: '%s'" % cmd)
- cmd_str = cmd
cmd = shlex.split(cmd)
result = ''
result_err = ''
- try:
- stdout = subprocess.PIPE
- stderr = subprocess.STDOUT if merge_stderr else subprocess.PIPE
- proc = subprocess.Popen(
- cmd, stdout=stdout, stderr=stderr)
- result, result_err = proc.communicate()
- if not fail_ok and proc.returncode != 0:
- raise CommandFailed(proc.returncode,
- cmd,
- result,
- stderr=result_err)
- finally:
- LOG.debug('output of %s:\n%s' % (cmd_str, result))
- if not merge_stderr and result_err:
- LOG.debug('error output of %s:\n%s' % (cmd_str, result_err))
+ stdout = subprocess.PIPE
+ stderr = subprocess.STDOUT if merge_stderr else subprocess.PIPE
+ proc = subprocess.Popen(
+ cmd, stdout=stdout, stderr=stderr)
+ result, result_err = proc.communicate()
+ if not fail_ok and proc.returncode != 0:
+ raise CommandFailed(proc.returncode,
+ cmd,
+ result,
+ stderr=result_err)
return result
def assertTableStruct(self, items, field_names):