aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjean.gaoliang@huawei.com <jean.gaoliang@huawei.com>2015-10-08 21:27:14 +0800
committerjean.gaoliang@huawei.com <jean.gaoliang@huawei.com>2015-10-09 11:25:33 +0800
commit89ee821fd10b1de5cd6d319347627ca540ac57c0 (patch)
tree520612d540c087666bbe93527cf62b4d39b37405
parent6175d493f0b07b96b34b1290822efd1adfe61fd2 (diff)
add a key check to fix bug
JIRA:YARDSTICK-160 Change-Id: I2cfe91b30d0c906417234d5bf7787fb5dc568921 Signed-off-by: jean.gaoliang@huawei.com <jean.gaoliang@huawei.com>
-rwxr-xr-xyardstick/cmd/commands/task.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 6e117edd0..85e35af2d 100755
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -136,9 +136,10 @@ class TaskParser(object):
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')
+ if "networks" in cfg_attrs:
+ for _, attrs in cfg_attrs["networks"].items():
+ attrs["external_network"] = os.environ.get(
+ 'EXTERNAL_NETWORK', 'net04_ext')
context = Context()
context.init(cfg_attrs)