diff options
author | Michael Ionkin <mionkin@mirantis.com> | 2016-01-27 17:14:45 +0300 |
---|---|---|
committer | Michael Ionkin <mionkin@mirantis.com> | 2016-02-11 17:45:47 +0300 |
commit | a3ac46644889e460f3f9e3fe89a87296d2a4ac8a (patch) | |
tree | a3db6f23bec617fa22e89698943875e916a663b5 | |
parent | b17daffd73df425fe573ab6e11990a7327d01f50 (diff) | |
download | python-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
-rw-r--r-- | doc/source/api.rst | 8 | ||||
-rw-r--r-- | requirements.txt | 1 | ||||
-rw-r--r-- | saharaclient/api/client.py | 20 | ||||
-rw-r--r-- | saharaclient/shell.py | 14 |
4 files changed, 18 insertions, 25 deletions
diff --git a/doc/source/api.rst b/doc/source/api.rst index 10f0838..f49e663 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -33,8 +33,8 @@ Session object should be used for this purpose. For example: .. sourcecode:: python - from keystoneclient.auth.identity import v2 - from keystoneclient import session + from keystoneauth1.identity import v2 + from keystoneauth1 import session from saharaclient import client auth = v2.Password(auth_url=AUTH_URL, @@ -62,8 +62,8 @@ default values. .. sourcecode:: python - from keystoneclient.auth.identity import v2 - from keystoneclient import session + from keystoneauth1.identity import v2 + from keystoneauth1 import session from saharaclient import client auth = v2.Password(auth_url=AUTH_URL, diff --git a/requirements.txt b/requirements.txt index 1a87ffc..a218e04 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ pbr>=1.6 # Apache-2.0 Babel>=1.3 # BSD cliff!=1.16.0,>=1.15.0 # Apache-2.0 +keystoneauth1>=2.1.0 # Apache-2.0 oslo.log>=1.14.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0 oslo.i18n>=2.1.0 # Apache-2.0 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, |