From 2ed435839c068d2734465318a07c2d7c2dd01a91 Mon Sep 17 00:00:00 2001 From: Cory Johns Date: Thu, 2 Mar 2017 09:40:39 -0500 Subject: [PATCH] Fix invalid model name if already contains username --- 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 3011a8a..dbd48c6 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -273,7 +273,8 @@ class Connection: username = accounts['user'] password = accounts.get('password') models = jujudata.models()[controller_name] - model_name = '{}/{}'.format(username, model_name) + if '/' not in model_name: + model_name = '{}/{}'.format(username, model_name) model_uuid = models['models'][model_name]['uuid'] macaroons = get_macaroons() if not password else None -- 2.25.1