diff options
author | liang gao <jean.gaoliang@huawei.com> | 2016-08-01 07:24:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-08-01 07:24:31 +0000 |
commit | fe46800c17c055ee337dddb2e2de00d6db128cda (patch) | |
tree | 0feb708dbf4213795cdf0846125a5f3fcc0f2249 /yardstick/cmd | |
parent | f29d785861ae0021ffe35b054ab77379253abb8b (diff) | |
parent | 2f5b58d700201a259c686d05b7f0c5a8814d6e1f (diff) |
Merge "Bugfix: Only add keyword "external_network" to the first network"
Diffstat (limited to 'yardstick/cmd')
-rw-r--r-- | yardstick/cmd/commands/task.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py index ca7c42897..b38e084ac 100644 --- a/yardstick/cmd/commands/task.py +++ b/yardstick/cmd/commands/task.py @@ -275,10 +275,16 @@ class TaskParser(object): for cfg_attrs in context_cfgs: context_type = cfg_attrs.get("type", "Heat") if "Heat" == context_type and "networks" in cfg_attrs: + # bugfix: if there are more than one network, + # only add "external_network" on first one. + # the name of netwrok should follow this rule: + # test, test2, test3 ... + # sort network with the length of network's name + sorted_networks = sorted(cfg_attrs["networks"].keys()) # config external_network based on env var - for _, attrs in cfg_attrs["networks"].items(): - attrs["external_network"] = os.environ.get( - 'EXTERNAL_NETWORK', 'net04_ext') + cfg_attrs["networks"][sorted_networks[0]]["external_network"] \ + = os.environ.get("EXTERNAL_NETWORK", "net04_ext") + context = Context.get(context_type) context.init(cfg_attrs) |