X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fns.py;fp=osm_lcm%2Fns.py;h=b030b5c7bc9d651a4793bd643401c2c74d50fb26;hb=f59ad6ce8e1e78b33f71d985b1deb41153ce5b71;hp=bcd1af9657f3fc39437e2a3fe49225b15b7927ba;hpb=49676bee9f4fd59d45f808362bb4cbc9e973241d;p=osm%2FLCM.git diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index bcd1af9..b030b5c 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -33,7 +33,7 @@ from osm_common.dbbase import DbException from osm_common.fsbase import FsException from n2vc.n2vc_juju_conn import N2VCJujuConnector -from n2vc.exceptions import N2VCException +from n2vc.exceptions import N2VCException, N2VCNotFound, K8sException from copy import copy, deepcopy from http import HTTPStatus @@ -2533,7 +2533,10 @@ class NsLcm(LcmBase): async def _delete_all_N2VC(self, db_nsr: dict): self._write_all_config_status(db_nsr=db_nsr, status='TERMINATING') namespace = "." + db_nsr["_id"] - await self.n2vc.delete_namespace(namespace=namespace, total_timeout=self.timeout_charm_delete) + try: + await self.n2vc.delete_namespace(namespace=namespace, total_timeout=self.timeout_charm_delete) + except N2VCNotFound: # already deleted. Skip + pass self._write_all_config_status(db_nsr=db_nsr, status='DELETED') async def _terminate_RO(self, logging_text, nsr_deployed, nsr_id, nslcmop_id, stage): @@ -3227,7 +3230,7 @@ class NsLcm(LcmBase): detailed_status)) return # database update is called inside finally - except (DbException, LcmException, N2VCException) as e: + except (DbException, LcmException, N2VCException, K8sException) as e: self.logger.error(logging_text + "Exit Exception {}".format(e)) exc = e except asyncio.CancelledError: