# TODO support get multi hosts/vms info
context_cfg = {}
- context_cfg['host'] = Context.get_server(scenario_cfg["host"])
+ if "host" in scenario_cfg:
+ context_cfg['host'] = Context.get_server(scenario_cfg["host"])
if "target" in scenario_cfg:
if is_ip_addr(scenario_cfg["target"]):
context_cfg["target"]["ipaddr"] = \
context_cfg["target"]["ip"]
+ if "nodes" in scenario_cfg:
+ context_cfg["nodes"] = parse_nodes_with_context(scenario_cfg)
runner = base_runner.Runner.get(runner_cfg)
print "Starting runner of type '%s'" % runner_cfg["type"]
return runner
+def parse_nodes_with_context(scenario_cfg):
+ '''paras the 'nodes' fields in scenario '''
+ nodes = scenario_cfg["nodes"]
+
+ nodes_cfg = {}
+ for nodename in nodes:
+ nodes_cfg[nodename] = Context.get_server(nodes[nodename])
+
+ return nodes_cfg
+
+
def runner_join(runner):
'''join (wait for) a runner, exit process at runner failure'''
status = runner.join()