summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorHaibin Huang <haibin.huang@intel.com>2019-07-29 06:20:14 +0000
committerHaibin Huang <haibin.huang@intel.com>2019-07-29 06:21:33 +0000
commit0f58e3fbde2064cf1f92430769835aa104ed8488 (patch)
tree3ac476b98c39c4f80a0d3205db4fdf600b71f1ae /lcm
parent93402f7440d9fa8e1d6de56c36d047c9aea73c54 (diff)
Fix network dict error
Issue-ID: VFC-1460 Signed-off-by: Haibin Huang <haibin.huang@intel.com> Change-Id: I84bf315f96db64efb985d3342a3ff555959e0bed
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/pub/vimapi/adaptor.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py
index 5c8386bd..62fd39fe 100644
--- a/lcm/lcm/pub/vimapi/adaptor.py
+++ b/lcm/lcm/pub/vimapi/adaptor.py
@@ -271,8 +271,11 @@ def create_port(vim_cache, res_cache, data, port, do_notify, res_type):
fixed_ip_address = ignore_case_get(l3_address_data, "fixed_ip_address")
ip_address.extend(fixed_ip_address)
for one_virtual_network_interface in port["properties"].get("virtual_network_interface_requirements", []):
- interfaceTypeString = one_virtual_network_interface["network_interface_requirements"]["interfaceType"]
- interfaceType = json.loads(interfaceTypeString)["configurationValue"]
+ network_interface_requirements = one_virtual_network_interface["network_interface_requirements"]
+ interfaceTypeString = ignore_case_get(network_interface_requirements, "interfaceType")
+ interfaceType = ""
+ if interfaceTypeString != "":
+ interfaceType = json.loads(interfaceTypeString)["configurationValue"]
vnic_type = ignore_case_get(port["properties"], "vnic_type")
if vnic_type == "":
if interfaceType == "SR-IOV":