summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-17 01:56:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-17 01:56:47 +0000
commit9c6eba101c7b656d077b95cf5d028551b0460aa1 (patch)
tree17d9bc11d3fb6098d13fb47f990876c277434119
parent641b52820afd1c61261cda954803cc335b818ccc (diff)
parent46383867760fa485fa20dbee69ca5ba72f50f467 (diff)
Merge "Verify the route list before parsing the data key"
-rw-r--r--yardstick/network_services/helpers/samplevnf_helper.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yardstick/network_services/helpers/samplevnf_helper.py b/yardstick/network_services/helpers/samplevnf_helper.py
index 1eefc5ffa..543d814df 100644
--- a/yardstick/network_services/helpers/samplevnf_helper.py
+++ b/yardstick/network_services/helpers/samplevnf_helper.py
@@ -499,7 +499,10 @@ class MultiPortConfig(object):
def get_route_data(self, src_key, data_key, port):
route_list = self.vnfd['vdu'][0].get(src_key, [])
- return next((route[data_key] for route in route_list if route['if'] == port), None)
+ try:
+ return next((route[data_key] for route in route_list if route['if'] == port), None)
+ except (TypeError, StopIteration, KeyError):
+ return None
def get_ports_gateway(self, port):
return self.get_route_data('routing_table', 'gateway', port)