From: tierno Date: Wed, 8 Apr 2020 12:50:52 +0000 (+0000) Subject: fix 1049. Ignore juju model delete not found exception X-Git-Tag: v7.1.0rc1~12 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F8774%2F1;p=osm%2FLCM.git fix 1049. Ignore juju model delete not found exception Change-Id: Ie0fb5a46b4da665a26e26cb9332a4825c0f6836e Signed-off-by: tierno --- diff --git a/osm_lcm/__init__.py b/osm_lcm/__init__.py index 0a279ad4..d0131019 100644 --- a/osm_lcm/__init__.py +++ b/osm_lcm/__init__.py @@ -13,8 +13,8 @@ ## # version moved to lcm.py. uncomment if LCM is installed as library and installed -version = '7.0.0.post10' -version_date = '2020-01-14' +version = '7.0.1.post18' +version_date = '2020-04-08' # Try to get version from package using pkg_resources (available with setuptools) try: diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index bcd1af96..b030b5c7 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: