X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=n2vc%2Flibjuju.py;h=a5b4d7e082cd4ef54cb81c1d5c08d2c16eace9d1;hb=5c9bb3a591c5f9fb48e491ae4afc3994ce2718dc;hp=8324cd42d54eb37788cf1704dad485163b97d9e6;hpb=85b467faa66414857be13995caca4806df6708cf;p=osm%2FN2VC.git diff --git a/n2vc/libjuju.py b/n2vc/libjuju.py index 8324cd4..a5b4d7e 100644 --- a/n2vc/libjuju.py +++ b/n2vc/libjuju.py @@ -1179,6 +1179,10 @@ class Libjuju: controller, timeout=total_timeout, ) + except Exception as e: + if not await self.model_exists(model_name, controller=controller): + return + raise e finally: if model: await self.disconnect_model(model) @@ -1210,6 +1214,10 @@ class Libjuju: raise Exception( "Timeout waiting for model {} to be destroyed".format(model_name) ) + except juju.errors.JujuError as e: + if any("has been removed" in error for error in e.errors): + return + raise e async def destroy_application( self, model_name: str, application_name: str, total_timeout: float