From: aktas Date: Tue, 19 Oct 2021 17:03:23 +0000 (+0300) Subject: Fix bug 1715 X-Git-Tag: release-v11.0-start~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F11278%2F2;p=osm%2FN2VC.git Fix bug 1715 In sometimes, it cannot catch that if the application is in the model. Jenkinks report: https://osm.etsi.org/jenkins/view/Robot%20tests/job/osm-stage_3-merge/job/v10.0/169/robot/report/report.html#tags?basic_20 Change-Id: I8121d57923d93b7af9ad60e07b87b4616060a916 Signed-off-by: aktas --- diff --git a/n2vc/libjuju.py b/n2vc/libjuju.py index b897bc6..6580067 100644 --- a/n2vc/libjuju.py +++ b/n2vc/libjuju.py @@ -791,6 +791,13 @@ class Libjuju: raise JujuApplicationExists( "Application {} exists".format(application_name) ) + except juju.errors.JujuError as e: + if "already exists" in e.message: + raise JujuApplicationExists( + "Application {} exists".format(application_name) + ) + else: + raise e finally: await self.disconnect_model(model) await self.disconnect_controller(controller)