From c5f519ef0e4f6a41b34f61a43104f2cae6dbfae7 Mon Sep 17 00:00:00 2001 From: Nikita Konovalov Date: Wed, 2 Oct 2013 19:13:10 +0400 Subject: [PATCH] Support for keystone v3 Fixes: bug #1234215 Change-Id: I099495742602e9f56dd33a2690b29960d04552c9 --- savannaclient/api/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/savannaclient/api/client.py b/savannaclient/api/client.py index c96ad1ec..1c974856 100644 --- a/savannaclient/api/client.py +++ b/savannaclient/api/client.py @@ -17,7 +17,8 @@ import six -from keystoneclient.v2_0 import client as keystone_client +from keystoneclient.v2_0 import client as keystone_client_v2 +from keystoneclient.v3 import client as keystone_client_v3 from savannaclient.api import cluster_templates from savannaclient.api import clusters @@ -44,6 +45,9 @@ class Client(object): if project_name and project_id: raise RuntimeError('Only project name or ' 'project id should be set') + keystone_client = keystone_client_v2 \ + if "v2.0" in auth_url \ + else keystone_client_v3 keystone = keystone_client.Client(username=username, password=api_key, token=input_auth_token,