From 7746c2261fafe02c45faa846276976e02a4a016a Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 3 Oct 2018 12:16:57 +0100 Subject: [PATCH] Ensure new model is disconnected from When Controller.add_model is called it returns a model, this model should be disconnected from otherwise stack-traces like the one reported in issue #135 occur. --- zaza/controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zaza/controller.py b/zaza/controller.py index 253b268..59d78ce 100644 --- a/zaza/controller.py +++ b/zaza/controller.py @@ -31,7 +31,8 @@ async def async_add_model(model_name, config=None): controller = Controller() await controller.connect() logging.debug("Adding model {}".format(model_name)) - await controller.add_model(model_name, config=config) + model = await controller.add_model(model_name, config=config) + await model.disconnect() await controller.disconnect() # NOTE: This is necessary to guarantee juju is aware of the newly created # model.