vnfd_mgmt_cp = vnfd.get("mgmt-cp")
for vdu in vnfd.get("vdu", ()):
+ vdu_mgmt_cp = []
+ try:
+ configs = vnfd.get("df")[0]["lcm-operations-configuration"]["operate-vnf-op-config"]["day1-2"]
+ vdu_config = utils.find_in_list(configs, lambda config: config["id"] == vdu["id"])
+ except Exception:
+ vdu_config = None
+
+ if vdu_config:
+ external_connection_ee = utils.filter_in_list(
+ vdu_config.get("execution-environment-list", []),
+ lambda ee: "external-connection-point-ref" in ee
+ )
+ for ee in external_connection_ee:
+ vdu_mgmt_cp.append(ee["external-connection-point-ref"])
+
additional_params, vdu_params = self._format_additional_params(
ns_request, vnf_index, vdu_id=vdu["id"], descriptor=vnfd)
vdur = {
if vnfd_mgmt_cp and vdu_iface.get("external-connection-point-ref") == vnfd_mgmt_cp:
vdu_iface["mgmt-vnf"] = True
- vdu_iface["mgmt-interface"] = True # TODO change to mgmt-vdu
+ vdu_iface["mgmt-interface"] = True
+
+ for ecp in vdu_mgmt_cp:
+ if vdu_iface.get("external-connection-point-ref") == ecp:
+ vdu_iface["mgmt-interface"] = True
if iface.get("virtual-interface"):
vdu_iface.update(deepcopy(iface["virtual-interface"]))
return None
+def filter_in_list(the_list, condition_lambda):
+ ret = []
+ for item in the_list:
+ if condition_lambda(item):
+ ret.append(item)
+ return ret
+
+
def find_index_in_list(the_list, condition_lambda):
for index, item in enumerate(the_list):
if condition_lambda(item):