From 9f303274516e43db97d065b9c6a9ac3980a2c0ce Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Wed, 9 Aug 2017 04:04:20 +0000 Subject: Bugfix: cannot run task if without yardstick.conf in danube JIRA: YARDSTICK-776 In danube.0.3.0, if we do not have yardstick.conf and then run task directly, we will get a RuntimeError, so yardstick.conf is must. This is not reasonable. In this patch, I fix it. So we can run it without yardstick.conf Change-Id: Ic069f67221da109db17cbd1bd51d299f6e267e6d Signed-off-by: chenjiankun --- yardstick/benchmark/core/task.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index 3a151dbba..b5e333a53 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -54,7 +54,11 @@ class Task(object): # pragma: no cover check_environment() - self.config['yardstick'] = utils.parse_ini_file(config_file) + try: + self.config['yardstick'] = utils.parse_ini_file(config_file) + except Exception: + # all error will be ignore, the default value is {} + self.config['yardstick'] = {} total_start_time = time.time() parser = TaskParser(args.inputfile[0]) -- cgit 1.2.3-korg