Usage of Plugins instead of keystone client.
In Kingbird there are few api calls which are deprecated in Pike release.This Fix is to address this issue. Closes-bug: #1712036 Change-Id: I605e3fabe8063999457bb67545029e83a33fee0c
This commit is contained in:
parent
8098e11854
commit
3906c41d43
|
@ -15,11 +15,11 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
from keystoneauth1.identity import v3 as auth_identity
|
|
||||||
from keystoneauth1 import loading
|
from keystoneauth1 import loading
|
||||||
from keystoneauth1 import session
|
from keystoneauth1 import session
|
||||||
from keystoneclient.auth import token_endpoint
|
|
||||||
from keystoneclient.v3 import client as keystone_client
|
from keystoneclient.v3 import client as keystone_client
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,24 +31,16 @@ class EndpointCache(object):
|
||||||
self._update_endpoints()
|
self._update_endpoints()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_admin_token(self):
|
def _get_endpoint_from_keystone(self):
|
||||||
auth = auth_identity.Password(
|
loader = loading.get_plugin_loader(
|
||||||
|
cfg.CONF.keystone_authtoken.auth_type)
|
||||||
|
auth = loader.load_from_options(
|
||||||
auth_url=cfg.CONF.cache.auth_uri,
|
auth_url=cfg.CONF.cache.auth_uri,
|
||||||
username=cfg.CONF.cache.admin_username,
|
username=cfg.CONF.cache.admin_username,
|
||||||
password=cfg.CONF.cache.admin_password,
|
password=cfg.CONF.cache.admin_password,
|
||||||
project_name=cfg.CONF.cache.admin_tenant,
|
project_id=cfg.CONF.cache.admin_tenant)
|
||||||
user_domain_name=cfg.CONF.cache.admin_user_domain_name,
|
self.admin_session = session.Session(auth=auth)
|
||||||
project_domain_name=cfg.CONF.cache.admin_project_domain_name)
|
cli = keystone_client.Client(session=self.admin_session)
|
||||||
sess = session.Session(auth=auth)
|
|
||||||
self.admin_session = sess
|
|
||||||
return sess.get_token()
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _get_endpoint_from_keystone(self):
|
|
||||||
auth = token_endpoint.Token(cfg.CONF.cache.auth_uri,
|
|
||||||
EndpointCache._get_admin_token(self))
|
|
||||||
sess = session.Session(auth=auth)
|
|
||||||
cli = keystone_client.Client(session=sess)
|
|
||||||
self.keystone_client = cli
|
self.keystone_client = cli
|
||||||
|
|
||||||
service_id_name_map = {}
|
service_id_name_map = {}
|
||||||
|
|
Loading…
Reference in New Issue