From b5f10cedabda7f8df1ea8f6fcae040efc343fb46 Mon Sep 17 00:00:00 2001 From: Cory Johns Date: Wed, 1 Mar 2017 11:49:58 -0500 Subject: [PATCH] Fix model name not including user The model names in models.yaml include the username prefix. Also fixed a lint error. --- juju/client/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index 9e8cb8f..3e304c1 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -267,6 +267,7 @@ class Connection: username = accounts['user'] password = accounts.get('password') models = jujudata.models()[controller_name] + model_name = '{}/{}'.format(username, model_name) model_uuid = models['models'][model_name]['uuid'] macaroons = get_macaroons() if not password else None @@ -349,7 +350,7 @@ def get_macaroons(): cookie_file = os.path.expanduser('~/.go-cookies') with open(cookie_file, 'r') as f: cookies = json.load(f) - except (OSError, ValueError) as e: + except (OSError, ValueError): log.warn("Couldn't load macaroons from %s", cookie_file) return [] -- 2.25.1