From: bravof Date: Thu, 25 Feb 2021 20:20:35 +0000 (-0300) Subject: fix/feat(relations): external connection point ref now works with multiple KDU X-Git-Tag: v9.1.2~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F10776%2F3;p=osm%2FLCM.git fix/feat(relations): external connection point ref now works with multiple KDU Change-Id: I01fac4167617450670999c87200bd3d8179f7293 Signed-off-by: bravof (cherry picked from commit 6ec62b7495f91c1c8388f835696d581ef35c69d6) --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 960fd31..bac3755 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2234,6 +2234,12 @@ class NsLcm(LcmBase): # Obtain management service info (if exists) vnfr_update_dict = {} + kdu_config = get_configuration(vnfd, kdud["name"]) + if kdu_config: + target_ee_list = kdu_config.get("execution-environment-list", []) + else: + target_ee_list = [] + if services: vnfr_update_dict["kdur.{}.services".format(kdu_index)] = services mgmt_services = [service for service in kdud.get("service", []) if service.get("mgmt-service")] @@ -2253,6 +2259,11 @@ class NsLcm(LcmBase): if deep_get(vnfd, ("mgmt-interface", "cp")) == service_external_cp: vnfr_update_dict["ip-address"] = ip + if find_in_list( + target_ee_list, + lambda ee: ee.get("external-connection-point-ref", "") == service_external_cp + ): + vnfr_update_dict["kdur.{}.ip-address".format(kdu_index)] = ip break else: self.logger.warn("Mgmt service name: {} not found".format(mgmt_service["name"]))