Fix bug 1718 80/11280/2 v10.0.3
authoraktas <emin.aktas@ulakhaberlesme.com.tr>
Tue, 19 Oct 2021 17:03:23 +0000 (20:03 +0300)
committeraktas <emin.aktas@ulakhaberlesme.com.tr>
Thu, 21 Oct 2021 15:21:16 +0000 (17:21 +0200)
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 <emin.aktas@ulakhaberlesme.com.tr>
(cherry picked from commit 42e51cfd7f807a2281ea3285d752b7142175da78)

n2vc/libjuju.py

index 6ece5d0..6aa31cc 100644 (file)
@@ -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)