X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fns.py;h=bac375534ec44fb5e8f87e669b6109aa3b85ac91;hb=refs%2Fchanges%2F76%2F10776%2F3;hp=230a9bf2e1510623243fb75c6369ec4c3960f764;hpb=2426025e4cd174e10f07f0a6d7444fb11790bc75;p=osm%2FLCM.git diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 230a9bf..bac3755 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2063,8 +2063,11 @@ class NsLcm(LcmBase): db_vnfd_list = db_nsr.get('vnfd-id') if db_vnfd_list: for vnfd in db_vnfd_list: + db_vnf_relations = None db_vnfd = self.db.get_one("vnfds", {"_id": vnfd}) - db_vnf_relations = get_configuration(db_vnfd, db_vnfd["id"]).get("relation", []) + db_vnf_configuration = get_configuration(db_vnfd, db_vnfd["id"]) + if db_vnf_configuration: + db_vnf_relations = db_vnf_configuration.get("relation", []) if db_vnf_relations: for r in db_vnf_relations: # check if this VCA is in the relation @@ -2231,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")] @@ -2250,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"]))