Rally task args broken due to type conversion

Looks like some recent upstream changes in packages cause dumping a
dictionary as a string to include the unicode reference in front of
the string. We can use json.dumps to avoid this issue.

Change-Id: I3c2dbc7cf372a02cb1d2a24eccb3a61d0cbd6168
This commit is contained in:
akrzos 2018-01-18 15:07:02 -05:00
parent 45c0d26d9d
commit 9784064211
1 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class Rally(workloadbase.WorkloadBase):
def run_scenario(self, task_file, scenario_args, result_dir, test_name, benchmark):
self.logger.debug("--------------------------------")
self.logger.debug("task_file: {}".format(task_file))
self.logger.info("Running with scenario_args: {}".format(scenario_args))
self.logger.info("Running with scenario_args: {}".format(json.dumps(scenario_args)))
self.logger.debug("result_dir: {}".format(result_dir))
self.logger.debug("test_name: {}".format(test_name))
self.logger.debug("--------------------------------")
@ -49,7 +49,7 @@ class Rally(workloadbase.WorkloadBase):
from_ts = int(time.time() * 1000)
if 'sleep_before' in self.config['rally']:
time.sleep(self.config['rally']['sleep_before'])
task_args = str(scenario_args).replace("'", "\"")
task_args = json.dumps(scenario_args)
plugins = []
if "plugins" in self.config['rally']:
if len(self.config['rally']['plugins']) > 0: