Fix invalid model name if already contains username
[osm/N2VC.git] / juju / client / connection.py
index 3011a8a..dbd48c6 100644 (file)
@@ -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