From: Cory Johns Date: Thu, 2 Mar 2017 14:40:39 +0000 (-0500) Subject: Fix invalid model name if already contains username X-Git-Tag: 0.4.0~16^2~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=2ed435839c068d2734465318a07c2d7c2dd01a91;p=osm%2FN2VC.git Fix invalid model name if already contains username --- 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