diff options
Diffstat (limited to 'yardstick/benchmark/core/task.py')
-rw-r--r-- | yardstick/benchmark/core/task.py | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index 87d70f42f..522ad4d23 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -85,7 +85,7 @@ class Task(object): # pragma: no cover # (hide it for exit handler) Context.list = [] else: - for context in Context.list: + for context in Context.list[::-1]: context.undeploy() Context.list = [] one_task_end_time = time.time() @@ -348,17 +348,23 @@ def atexit_handler(): if len(Context.list) > 0: print("Undeploying all contexts") - for context in Context.list: + for context in Context.list[::-1]: context.undeploy() def is_ip_addr(addr): """check if string addr is an IP address""" try: + addr = addr.get('public_ip_attr', addr.get('private_ip_attr')) + except AttributeError: + pass + + try: ipaddress.ip_address(addr.encode('utf-8')) - return True except ValueError: return False + else: + return True def _is_same_heat_context(host_attr, target_attr): @@ -499,14 +505,24 @@ def check_environment(): def change_server_name(scenario, suffix): try: - scenario['host'] += suffix + host = scenario['host'] except KeyError: pass + else: + try: + host['name'] += suffix + except TypeError: + scenario['host'] += suffix try: - scenario['target'] += suffix + target = scenario['target'] except KeyError: pass + else: + try: + target['name'] += suffix + except TypeError: + scenario['target'] += suffix try: key = 'targets' |