aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/core/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/core/task.py')
-rw-r--r--yardstick/benchmark/core/task.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py
index 478a51f9d..9c6caf03f 100644
--- a/yardstick/benchmark/core/task.py
+++ b/yardstick/benchmark/core/task.py
@@ -20,6 +20,8 @@ import time
import logging
import uuid
import errno
+import collections
+
from six.moves import filter
from yardstick.benchmark.contexts.base import Context
@@ -51,7 +53,8 @@ class Task(object): # pragma: no cover
atexit.register(self.atexit_handler)
- self.task_id = kwargs.get('task_id', str(uuid.uuid4()))
+ task_id = getattr(args, 'task_id')
+ self.task_id = task_id if task_id else str(uuid.uuid4())
check_environment()
@@ -133,6 +136,7 @@ class Task(object): # pragma: no cover
scenario['task_id'], scenario['tc'])
print("Done, exiting")
+ return result
def _init_output_config(self, output_config):
output_config.setdefault('DEFAULT', {})
@@ -594,6 +598,9 @@ def print_invalid_header(source_name, args):
def parse_task_args(src_name, args):
+ if isinstance(args, collections.Mapping):
+ return args
+
try:
kw = args and yaml.safe_load(args)
kw = {} if kw is None else kw