projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add deleting lock to K8sJujuConnector
[osm/N2VC.git]
/
n2vc
/
libjuju.py
diff --git
a/n2vc/libjuju.py
b/n2vc/libjuju.py
index
8324cd4
..
a5b4d7e
100644
(file)
--- a/
n2vc/libjuju.py
+++ b/
n2vc/libjuju.py
@@
-1179,6
+1179,10
@@
class Libjuju:
controller,
timeout=total_timeout,
)
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)
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)
)
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
async def destroy_application(
self, model_name: str, application_name: str, total_timeout: float