From: Gabriel Cuba Date: Thu, 21 Mar 2024 22:14:05 +0000 (-0500) Subject: Fixes VCA deletion in NS termination X-Git-Tag: release-v16.0-start~16 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=9cd5345320bde874db53c9e5dabd9c6c871ccfdf;p=osm%2FLCM.git Fixes VCA deletion in NS termination Change-Id: I3abfed8a389620cdc1ef8207a53c53c8c7ba6854 Signed-off-by: Gabriel Cuba --- diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 57298bd..8e42ddc 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -4522,16 +4522,8 @@ class NsLcm(LcmBase): if nsr_deployed.get("VCA"): stage[1] = "Deleting all execution environments." self.logger.debug(logging_text + stage[1]) - if nsr_deployed.get("VCA").get("type") != "helm-v3": - vca_id = self.get_vca_id({}, db_nsr) - task_delete_ee = asyncio.ensure_future( - asyncio.wait_for( - self._delete_all_N2VC(db_nsr=db_nsr, vca_id=vca_id), - timeout=self.timeout.charm_delete, - ) - ) - tasks_dict_info[task_delete_ee] = "Terminating all VCA" - else: + helm_vca_list = get_deployed_vca(db_nsr, {"type": "helm-v3"}) + if helm_vca_list: # Delete Namespace and Certificates await self.vca_map["helm-v3"].delete_tls_certificate( namespace=db_nslcmop["nsInstanceId"], @@ -4540,6 +4532,15 @@ class NsLcm(LcmBase): await self.vca_map["helm-v3"].delete_namespace( namespace=db_nslcmop["nsInstanceId"], ) + else: + vca_id = self.get_vca_id({}, db_nsr) + task_delete_ee = asyncio.ensure_future( + asyncio.wait_for( + self._delete_all_N2VC(db_nsr=db_nsr, vca_id=vca_id), + timeout=self.timeout.charm_delete, + ) + ) + tasks_dict_info[task_delete_ee] = "Terminating all VCA" # Delete from k8scluster stage[1] = "Deleting KDUs."