From b76442ae720ec190e8b70416cc445fb9a8c7de80 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Fri, 28 May 2021 12:08:18 +0200 Subject: [PATCH] Fix 1533 (nscharms): read juju from descriptor In the VNFD, the juju section has been removed and included inside the execution environment list. Since then basic_12 (nscharms) has not been properly working because we are only looking for the execution-environment-liist key inside the descriptor, but that does not apply to the NSD. Additionally, I fixed the deletion of the nscharm, that was failing due to the member-vnf-index key not existing in the deployed VCA. Change-Id: Icb3220f28e373cf8ac3f978c9a3a83b179540512 Signed-off-by: David Garcia (cherry picked from commit 9ad54a4e89136b65a6ae8aad7c5f4ae494256f68) --- osm_lcm/ns.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 2f0d6f6..78c58f8 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -3287,6 +3287,8 @@ class NsLcm(LcmBase): ) if "execution-environment-list" in descriptor_config: ee_list = descriptor_config.get("execution-environment-list", []) + elif "juju" in descriptor_config: + ee_list = [descriptor_config] # ns charms else: # other types as script are not supported ee_list = [] @@ -4040,8 +4042,13 @@ class NsLcm(LcmBase): for vca_index, vca in enumerate(get_iterable(nsr_deployed, "VCA")): config_descriptor = None - - vca_id = self.get_vca_id(db_vnfrs_dict[vca["member-vnf-index"]], db_nsr) + vca_member_vnf_index = vca.get("member-vnf-index") + vca_id = self.get_vca_id( + db_vnfrs_dict.get(vca_member_vnf_index) + if vca_member_vnf_index + else None, + db_nsr, + ) if not vca or not vca.get("ee_id"): continue if not vca.get("member-vnf-index"): -- 2.17.1