Fix bug 601
This fixes bug 601, where a charm in a broken state would fail to be
removed.
This builds of of the new DestroyNetworkService method, which will
remove a model containing a network service.
There is no way, currently, to resolve errors on an individual charm
through the Juju API (client), but removing the model will force the
removal of a broken charm.
Change-Id: I47f41991ed444395061b5a20e5a51059950e5200
Signed-off-by: Adam Israel <adam.israel@canonical.com>
diff --git a/tests/base.py b/tests/base.py
index e4111eb..41fa191 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -586,6 +586,9 @@
if not self.n2vc:
self.n2vc = get_n2vc(loop=loop)
+ debug("Creating model for Network Service {}".format(self.ns_name))
+ await self.n2vc.CreateNetworkService(self.ns_name)
+
application = self.n2vc.FormatApplicationName(
self.ns_name,
self.vnf_name,
@@ -889,6 +892,8 @@
try:
await self.n2vc.RemoveCharms(self.ns_name, application)
+ await self.n2vc.DestroyNetworkService(self.ns_name)
+
while True:
# Wait for the application to be removed
await asyncio.sleep(10)