summaryrefslogtreecommitdiffstats
path: root/yardstick/cmd/commands/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/cmd/commands/task.py')
-rwxr-xr-xyardstick/cmd/commands/task.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 5c25c576a..5eb38989a 100755
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -16,7 +16,7 @@ import atexit
import pkg_resources
import ipaddress
-from yardstick.benchmark.context.model import Context
+from yardstick.benchmark.contexts.base import Context
from yardstick.benchmark.runners import base as base_runner
from yardstick.common.task_template import TaskTemplate
from yardstick.common.utils import cliargs
@@ -194,18 +194,20 @@ class TaskParser(object):
self._check_schema(cfg["schema"], "task")
# TODO: support one or many contexts? Many would simpler and precise
+ # TODO: support hybrid context type
if "context" in cfg:
context_cfgs = [cfg["context"]]
else:
context_cfgs = cfg["contexts"]
for cfg_attrs in context_cfgs:
- # config external_network based on env var
- if "networks" in cfg_attrs:
+ context_type = cfg_attrs.get("type", "Heat")
+ if "Heat" == context_type and "networks" in cfg_attrs:
+ # config external_network based on env var
for _, attrs in cfg_attrs["networks"].items():
attrs["external_network"] = os.environ.get(
'EXTERNAL_NETWORK', 'net04_ext')
- context = Context()
+ context = Context.get(context_type)
context.init(cfg_attrs)
run_in_parallel = cfg.get("run_in_parallel", False)
@@ -245,6 +247,7 @@ def run_one_scenario(scenario_cfg, output_file):
key_filename = pkg_resources.resource_filename(
'yardstick.resources', 'files/yardstick_key')
+ # TODO support get multi hosts/vms info
host = Context.get_server(scenario_cfg["host"])
runner_cfg = scenario_cfg["runner"]