From 49676bee9f4fd59d45f808362bb4cbc9e973241d Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 7 Apr 2020 16:34:35 +0000 Subject: [PATCH] delete juju model when some VCA has been deployed Change-Id: Ia3acac75e5eae46305e70b30d1b9a6b38a4d750a Signed-off-by: tierno --- osm_lcm/ns.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index a5f9473..bcd1af9 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -2781,13 +2781,14 @@ class NsLcm(LcmBase): # remove All execution environments at once stage[0] = "Stage 3/3 delete all." - stage[1] = "Deleting all execution environments." - self.logger.debug(logging_text + stage[1]) - task_delete_ee = asyncio.ensure_future(asyncio.wait_for(self._delete_all_N2VC(db_nsr=db_nsr), - timeout=self.timeout_charm_delete)) - # task_delete_ee = asyncio.ensure_future(self.n2vc.delete_namespace(namespace="." + nsr_id)) - tasks_dict_info[task_delete_ee] = "Terminating all VCA" + if nsr_deployed.get("VCA"): + stage[1] = "Deleting all execution environments." + self.logger.debug(logging_text + stage[1]) + task_delete_ee = asyncio.ensure_future(asyncio.wait_for(self._delete_all_N2VC(db_nsr=db_nsr), + timeout=self.timeout_charm_delete)) + # task_delete_ee = asyncio.ensure_future(self.n2vc.delete_namespace(namespace="." + nsr_id)) + tasks_dict_info[task_delete_ee] = "Terminating all VCA" # Delete from k8scluster stage[1] = "Deleting KDUs." -- 2.25.1