summaryrefslogtreecommitdiff
path: root/saharaclient
diff options
context:
space:
mode:
authorMichael Ionkin <mionkin@mirantis.com>2016-01-27 17:14:45 +0300
committerMichael Ionkin <mionkin@mirantis.com>2016-02-11 17:45:47 +0300
commita3ac46644889e460f3f9e3fe89a87296d2a4ac8a (patch)
treea3db6f23bec617fa22e89698943875e916a663b5 /saharaclient
parentb17daffd73df425fe573ab6e11990a7327d01f50 (diff)
downloadpython-saharaclient-a3ac46644889e460f3f9e3fe89a87296d2a4ac8a.tar.gz
Keystoneclient to keystoneauth migration
Keystoneauth was extracted from keystoneclient so we need to migrate to keystoneauth also deleted get_projects_list method because it is not used Change-Id: I2c611d6b5ae08eacc11513e0dd2548e42b9dc828 bp: keystoneclient-to-keystoneauth
Diffstat (limited to 'saharaclient')
-rw-r--r--saharaclient/api/client.py20
-rw-r--r--saharaclient/shell.py14
2 files changed, 13 insertions, 21 deletions
diff --git a/saharaclient/api/client.py b/saharaclient/api/client.py
index 0343a7c..1fd7602 100644
--- a/saharaclient/api/client.py
+++ b/saharaclient/api/client.py
@@ -15,13 +15,12 @@
import warnings
-from keystoneclient import adapter
-from keystoneclient.auth.identity import v2
-from keystoneclient.auth.identity import v3
-from keystoneclient.auth import token_endpoint
-from keystoneclient import exceptions
-from keystoneclient import session as keystone_session
-from keystoneclient.v2_0 import client as keystone_client_v2
+from keystoneauth1 import adapter
+from keystoneauth1 import exceptions
+from keystoneauth1.identity import v2
+from keystoneauth1.identity import v3
+from keystoneauth1 import session as keystone_session
+from keystoneauth1 import token_endpoint
from saharaclient.api import cluster_templates
from saharaclient.api import clusters
@@ -187,10 +186,3 @@ class Client(object):
return st
raise RuntimeError("Could not find Sahara endpoint in catalog")
-
- @staticmethod
- def get_projects_list(keystone_client):
- if isinstance(keystone_client, keystone_client_v2.Client):
- return keystone_client.tenants
-
- return keystone_client.projects
diff --git a/saharaclient/shell.py b/saharaclient/shell.py
index 682b808..b0236eb 100644
--- a/saharaclient/shell.py
+++ b/saharaclient/shell.py
@@ -48,10 +48,10 @@ try:
except ImportError:
pass
-from keystoneclient.auth.identity.generic import password
-from keystoneclient.auth.identity.generic import token
+from keystoneauth1.identity.generic import password
+from keystoneauth1.identity.generic import token
+from keystoneauth1.loading import session
from keystoneclient.auth.identity import v3 as identity
-from keystoneclient import session
from oslo_utils import encodeutils
from oslo_utils import strutils
@@ -354,8 +354,8 @@ class OpenStackSaharaShell(object):
default=cliutils.env('OS_AUTH_TOKEN'),
help='Defaults to env[OS_AUTH_TOKEN].')
- # Use Keystoneclient API to parse authentication arguments
- session.Session.register_cli_options(parser)
+ # Use Keystoneclient/Keystoneauth API to parse authentication arguments
+ session.Session().register_argparse_arguments(parser)
identity.Password.register_argparse_arguments(parser)
return parser
@@ -623,8 +623,8 @@ class OpenStackSaharaShell(object):
project_id = args.os_project_id or args.os_tenant_id
project_name = args.os_project_name or args.os_tenant_name
- keystone_session = (session.Session.
- load_from_cli_options(args))
+ keystone_session = (session.Session().
+ load_from_argparse_arguments(args))
keystone_auth = self._get_keystone_auth(
keystone_session,
args.os_auth_url,