Fix bug 1718
[osm/N2VC.git] / n2vc / libjuju.py
index 9961e19..6aa31cc 100644 (file)
@@ -642,7 +642,6 @@ class Libjuju:
         :param: application_name:   Application name
         :param: model_name:         Model name
         :param: machine_id          Machine id
-        :param: db_dict:            Dictionary with data of the DB to write the updates
         :param: total_timeout:      Timeout for the entity to be active
 
         :return: None
@@ -792,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)