diff --git a/vitrage/common/constants.py b/vitrage/common/constants.py index 4ab315624..af08bd6bc 100644 --- a/vitrage/common/constants.py +++ b/vitrage/common/constants.py @@ -63,8 +63,7 @@ class EdgeLabel(object): @staticmethod def labels(): - return [EdgeLabel.__dict__[label] - for label in vars(EdgeLabel) + return [value for label, value in vars(EdgeLabel).items() if not label.startswith(('_', 'labels'))] @@ -86,8 +85,7 @@ class EntityCategory(object): @staticmethod def categories(): - return [EntityCategory.__dict__[category] - for category in vars(EntityCategory) + return [value for category, value in vars(EntityCategory).items() if not category.startswith(('_', 'categories'))] diff --git a/vitrage_tempest_tests/tests/utils.py b/vitrage_tempest_tests/tests/utils.py index f42947e94..02fd3c4d6 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):