From c00f0f4fdab37db3bf084c879ac6186054726916 Mon Sep 17 00:00:00 2001 From: QiLiang Date: Mon, 27 Jul 2015 10:39:24 +0000 Subject: 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 --- yardstick/cmd/commands/task.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yardstick/cmd') 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) -- cgit 1.2.3-korg