Merge "don't log cli output on success"
This commit is contained in:
@@ -114,25 +114,19 @@ class ClientTestBase(tempest.test.BaseTestCase):
|
|||||||
cmd = ' '.join([os.path.join(CONF.cli.cli_dir, cmd),
|
cmd = ' '.join([os.path.join(CONF.cli.cli_dir, cmd),
|
||||||
flags, action, params])
|
flags, action, params])
|
||||||
LOG.info("running: '%s'" % cmd)
|
LOG.info("running: '%s'" % cmd)
|
||||||
cmd_str = cmd
|
|
||||||
cmd = shlex.split(cmd)
|
cmd = shlex.split(cmd)
|
||||||
result = ''
|
result = ''
|
||||||
result_err = ''
|
result_err = ''
|
||||||
try:
|
stdout = subprocess.PIPE
|
||||||
stdout = subprocess.PIPE
|
stderr = subprocess.STDOUT if merge_stderr else subprocess.PIPE
|
||||||
stderr = subprocess.STDOUT if merge_stderr else subprocess.PIPE
|
proc = subprocess.Popen(
|
||||||
proc = subprocess.Popen(
|
cmd, stdout=stdout, stderr=stderr)
|
||||||
cmd, stdout=stdout, stderr=stderr)
|
result, result_err = proc.communicate()
|
||||||
result, result_err = proc.communicate()
|
if not fail_ok and proc.returncode != 0:
|
||||||
if not fail_ok and proc.returncode != 0:
|
raise CommandFailed(proc.returncode,
|
||||||
raise CommandFailed(proc.returncode,
|
cmd,
|
||||||
cmd,
|
result,
|
||||||
result,
|
stderr=result_err)
|
||||||
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))
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def assertTableStruct(self, items, field_names):
|
def assertTableStruct(self, items, field_names):
|
||||||
|
|||||||
Reference in New Issue
Block a user