From 04a49eccfcb8b8cefa72e00654a2f3b8eea77251 Mon Sep 17 00:00:00 2001 From: Eyal Date: Sun, 14 Jan 2018 10:37:48 +0200 Subject: [PATCH] add some logging remove pypy from tox we don't support pypy Change-Id: Ia3f146ebfdb310324fc0b9840b3dca2191918f5f --- tox.ini | 2 +- vitrage_tempest_tests/tests/utils.py | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tox.ini b/tox.ini index deb7b4a..cc876b5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py34,py27,pypy,pep8 +envlist = py34,py27,pep8 skipsdist = True [testenv] diff --git a/vitrage_tempest_tests/tests/utils.py b/vitrage_tempest_tests/tests/utils.py index f42947e..02fd3c4 100644 --- a/vitrage_tempest_tests/tests/utils.py +++ b/vitrage_tempest_tests/tests/utils.py @@ -77,17 +77,25 @@ def run_vitrage_command(command, conf): LOG.info('Full command: %s', full_command) - p = subprocess.Popen(full_command, - shell=True, - executable="/bin/bash", - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = p.communicate() + child = subprocess.Popen(full_command, + shell=True, + executable="/bin/bash", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + + stdout, stderr = child.communicate() if stderr: LOG.error('error from command %(command)s = %(error)s', {'error': stderr, 'command': full_command}) - return stdout.decode('utf-8') + output = stdout.decode('utf-8') + + LOG.info('cli stdout: %s', output) + + if child.returncode: + LOG.error('process return code is not 0 : return code = %d', + child.returncode) + return output def get_property_value(environment_name, conf_name, default_value, conf):