aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/cmd
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2015-07-27 10:39:24 +0000
committerQiLiang <liangqi1@huawei.com>2015-09-06 18:22:15 +0800
commitc00f0f4fdab37db3bf084c879ac6186054726916 (patch)
tree99f914a9ba70a87c97a25c812e21b1d59ea7b64e /yardstick/cmd
parent3c3917962ec72fb8ee7cb39bbf126be90c1033d3 (diff)
Support to config external network by shell env
Example invocation: $ export EXTERNAL_NETWORK=net04_ext $ yardstick task start samples/ping.yaml The default external network is "net04_ext" external_net should not be possible set in yaml anymore. JIRA: YARDSTICK-54 Change-Id: I8c7b2850801f312c6878e9a363b06cdc8ade09bf Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'yardstick/cmd')
-rwxr-xr-xyardstick/cmd/commands/task.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index f49a258a1..6e117edd0 100755
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -135,6 +135,10 @@ class TaskParser(object):
context_cfgs = cfg["contexts"]
for cfg_attrs in context_cfgs:
+ # 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.init(cfg_attrs)