diff options
Diffstat (limited to 'yardstick/benchmark')
-rw-r--r-- | yardstick/benchmark/core/runner.py | 2 | ||||
-rw-r--r-- | yardstick/benchmark/core/scenario.py | 2 | ||||
-rw-r--r-- | yardstick/benchmark/core/task.py | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/yardstick/benchmark/core/runner.py b/yardstick/benchmark/core/runner.py index b9c22cbc9..64acdaa99 100644 --- a/yardstick/benchmark/core/runner.py +++ b/yardstick/benchmark/core/runner.py @@ -15,7 +15,7 @@ from yardstick.benchmark.runners.base import Runner from yardstick.benchmark.core import print_hbar -class Runners(object): +class Runners(object): # pragma: no cover """Runner commands. Set of commands to discover and display runner types. diff --git a/yardstick/benchmark/core/scenario.py b/yardstick/benchmark/core/scenario.py index a9d933faf..cd119c24c 100644 --- a/yardstick/benchmark/core/scenario.py +++ b/yardstick/benchmark/core/scenario.py @@ -15,7 +15,7 @@ from yardstick.benchmark.scenarios.base import Scenario from yardstick.benchmark.core import print_hbar -class Scenarios(object): +class Scenarios(object): # pragma: no cover """Scenario commands. Set of commands to discover and display scenario types. 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 |