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
This commit is contained in:
Michael Ionkin 2016-01-27 17:14:45 +03:00
parent b17daffd73
commit a3ac466448
4 changed files with 18 additions and 25 deletions

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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,