X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=lcm%2Flcm%2Fpub%2Fvimapi%2Fadaptor.py;h=6cda0af0fb077aeddca5e84d46fb9e8e53b1f95c;hb=8ccc938635ceb5079c63a5cb20cf804a9954a8b4;hp=5c8386bd8f7407ef449c989eb1ebeaf66335cc9c;hpb=391f841b3c4ec5a0e10ae5c242f7e16209ec98d6;p=vfc%2Fgvnfm%2Fvnflcm.git diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py index 5c8386bd..6cda0af0 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": @@ -404,6 +407,8 @@ def create_vm(vim_cache, res_cache, data, vm, do_notify, res_type): ret = api.create_vm(vim_id, tenant_id, param) ret["ports"] = [nic.get("portId") for nic in param["nicArray"]] + ret["vimId"] = vim_id + ret["tenantId"] = tenant_id do_notify(res_type, ret) vm_id = ret["id"] if ignore_case_get(ret, "name"):