if guest_epa:
flavor_data["guest-epa"] = guest_epa
- f = next((f for f in nsr_descriptor["flavor"] if
- all(f.get(k) == flavor_data[k] for k in flavor_data)), None)
- if not f:
- flavor_data["vim_info"] = []
- flavor_data["name"] = vdu["id"][:56] + "-flv"
- flavor_data["id"] = str(len(nsr_descriptor["flavor"]))
- nsr_descriptor["flavor"].append(flavor_data)
+ flavor_data["vim_info"] = []
+ flavor_data["name"] = vdu["id"][:56] + "-flv"
+ flavor_data["id"] = str(len(nsr_descriptor["flavor"]))
+ nsr_descriptor["flavor"].append(flavor_data)
sw_image_id = vdu.get("sw-image-desc")
if sw_image_id:
vdu_iface["mgmt-vnf"] = True
vdu_iface["mgmt-interface"] = True # TODO change to mgmt-vdu
+ if iface.get("virtual-interface"):
+ vdu_iface.update(deepcopy(iface["virtual-interface"]))
+
# look for network where this interface is connected
iface_ext_cp = vdu_iface.get("external-connection-point-ref")
if iface_ext_cp:
if indata.get("member_vnf_index"):
vnfd = self._get_vnfd_from_vnf_member_index(indata["member_vnf_index"], nsr["_id"])
if indata.get("vdu_id"):
- vdud = self._check_valid_vdu(vnfd, indata["vdu_id"])
- descriptor_configuration = vdud.get("vdu-configuration", {}).get("config-primitive")
+ self._check_valid_vdu(vnfd, indata["vdu_id"])
+ # TODO: Change the [0] as vdu-configuration is now a list
+ descriptor_configuration = vnfd.get("vdu-configuration", [{}])[0].get("config-primitive")
elif indata.get("kdu_name"):
- kdud = self._check_valid_kdu(vnfd, indata["kdu_name"])
- descriptor_configuration = kdud.get("kdu-configuration", {}).get("config-primitive")
+ self._check_valid_kdu(vnfd, indata["kdu_name"])
+ # TODO: Change the [0] as kdu-configuration is now a list
+ descriptor_configuration = vnfd.get("kdu-configuration", [{}])[0].get("config-primitive")
else:
- # TODO: Validate the [0] as vnf-configuration is now a list
- descriptor_configuration = vnfd.get("vnf-configuration", {})[0].get("config-primitive")
+ # TODO: Change the [0] as vnf-configuration is now a list
+ descriptor_configuration = vnfd.get("vnf-configuration", [{}])[0].get("config-primitive")
else: # use a NSD
descriptor_configuration = nsd.get("ns-configuration", {}).get("config-primitive")