From f79e8293b6f5ec37b8b2582f6a25fa2e75d9fb6e Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Thu, 2 Feb 2017 14:16:44 -0500 Subject: [PATCH] Add support for Neutron Metadata Service This adds logic to the set_scenario() and send_to_elastic() methods to be generic enough to support miscalleneous shaker scenarios like metadata agent performance testing. + Few minor changes Change-Id: Ib9499d23b44160fc0796827f53e9926fca5e7e88 --- lib/Shaker.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Shaker.py b/lib/Shaker.py index 603030ac1..4b501fa25 100644 --- a/lib/Shaker.py +++ b/lib/Shaker.py @@ -167,7 +167,8 @@ class Shaker(WorkloadBase.WorkloadBase): 'scenarios'][scenario]['deployment']['template'] # Iterating through each record to get result values for record in data['records'].iterkeys(): - if data['records'][record]['status'] == "ok": + if data['records'][record]['status'] == "ok" and data[ + 'records'][record]['executor'] != "shell": if 'stdout' in data['records'][record]: del data['records'][record]['stdout'] metadata = data['records'][record].pop('meta') @@ -216,7 +217,8 @@ class Shaker(WorkloadBase.WorkloadBase): if index_status is False: failure = True else: - # If the status of the record is not ok, ship minimal + # If the status of the record is not OK or if the type of + # executor is shell, ship minimal # shaker_stats dictionary to ES shaker_stats = { 'record': data['records'][record], @@ -269,14 +271,14 @@ class Shaker(WorkloadBase.WorkloadBase): accommodation = self.accommodation_to_list(accommodation) self.logger.debug("Using accommodation {}".format(accommodation)) data['deployment']['accommodation'] = accommodation - if "progression" in scenario: + if 'progression' in scenario and 'progression' in data['execution']: if scenario['progression'] is None: data['execution'].pop('progression', None) else: data['execution']['progression'] = scenario['progression'] - else: + elif 'progression' in data['execution']: data['execution']['progression'] = default_progression - if "time" in scenario: + if 'time' in scenario: for test in data['execution']['tests']: test['time'] = scenario['time'] else: