from juju.controller import Controller
import asyncio
from logging import getLogger
+import uuid
LOG = getLogger(__name__)
await controller.connect_current()
try:
- model_name = "quux"
+ model_name = "addmodeltest-{}".format(uuid.uuid4())
+ print("Adding model {}".format(model_name))
model = await controller.add_model(model_name)
print('Deploying ubuntu')
print("Destroying model")
await controller.destroy_model(model.info.uuid)
+ except Exception as e:
+ LOG.exception(
+ "Test failed! Model {} may not be cleaned up".format(model_name))
+
finally:
print('Disconnecting from controller')
await model.disconnect()