aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)