Use the new keystonemiddleware module

The keystoneclient.middleware module is deprecated

Change-Id: I1fbf84a54dd3ee1306ea8c8e5e767ff2d959df22
Closes-Bug: #1377822
This commit is contained in:
Abhishek Chanda 2014-10-07 16:54:28 -07:00
parent 51405257e9
commit bdc7362b64
6 changed files with 10 additions and 10 deletions

View File

@ -21,3 +21,4 @@ six>=1.7.0
SQLAlchemy>=0.8.4,!=0.9.5,<=0.9.99
WSME>=0.6
python-mistralclient>=0.1
keystonemiddleware>=1.0.0

View File

@ -15,7 +15,7 @@
import re
from keystoneclient.middleware import auth_token
from keystonemiddleware import auth_token
from oslo.config import cfg
from pecan import hooks
@ -38,7 +38,6 @@ AUTH_OPTS = [
CONF = cfg.CONF
CONF.register_opts(AUTH_OPTS)
CONF.register_opts(auth_token.opts, group=OPT_GROUP_NAME)
PUBLIC_ENDPOINTS = [
'^/?$',
@ -84,7 +83,7 @@ class AuthProtocolWrapper(auth_token.AuthProtocol):
def __call__(self, env, start_response):
path = env.get('PATH_INFO')
if AUTH.is_endpoint_public(path):
return self.app(env, start_response)
return self._app(env, start_response)
return super(AuthProtocolWrapper, self).__call__(env, start_response)
@ -122,7 +121,7 @@ class AuthInformationHook(hooks.PecanHook):
raise Exception('Not authorized')
auth_url = headers.get('X-Auth-Url')
if auth_url is None:
importutils.import_module('keystoneclient.middleware.auth_token')
importutils.import_module('keystonemiddleware.auth_token')
auth_url = cfg.CONF.keystone_authtoken.auth_uri
auth_token_info = state.request.environ.get('keystone.token_info')

View File

@ -36,7 +36,7 @@ class BarbicanClient(object):
def _barbican_admin_init(self):
# Import auth_token to have keystone_authtoken settings setup.
importutils.import_module('keystoneclient.middleware.auth_token')
importutils.import_module('keystonemiddleware.auth_token')
auth = identity.v2.Password(
auth_url=cfg.CONF.keystone_authtoken.auth_uri,
username=cfg.CONF.keystone_authtoken.admin_user,

View File

@ -32,7 +32,7 @@ trust_opts = [
help=_('Subset of trustor roles to be delegated to solum.')),
]
cfg.CONF.register_opts(trust_opts)
cfg.CONF.import_opt('auth_uri', 'keystoneclient.middleware.auth_token',
cfg.CONF.import_opt('auth_uri', 'keystonemiddleware.auth_token',
group='keystone_authtoken')
@ -59,7 +59,7 @@ class KeystoneClientV3(object):
self.v3_endpoint = self.context.auth_url.replace('v2.0', 'v3')
else:
# Import auth_token to have keystone_authtoken settings setup.
importutils.import_module('keystoneclient.middleware.auth_token')
importutils.import_module('keystonemiddleware.auth_token')
self.v3_endpoint = cfg.CONF.keystone_authtoken.auth_uri.replace(
'v2.0', 'v3')
@ -144,7 +144,7 @@ class KeystoneClientV3(object):
def _service_admin_creds(self):
# Import auth_token to have keystone_authtoken settings setup.
importutils.import_module('keystoneclient.middleware.auth_token')
importutils.import_module('keystonemiddleware.auth_token')
creds = {
'username': cfg.CONF.keystone_authtoken.admin_user,
'password': cfg.CONF.keystone_authtoken.admin_password,

View File

@ -16,7 +16,7 @@ import mock
from oslo.config import cfg
cfg.CONF.import_group('keystone_authtoken',
'keystoneclient.middleware.auth_token')
'keystonemiddleware.auth_token')
import keystoneclient.exceptions as kc_exception # noqa

View File

@ -1,2 +1,2 @@
SOLUM_CONFIG_GENERATOR_EXTRA_LIBRARIES="oslo.messaging oslo.db"
SOLUM_CONFIG_GENERATOR_EXTRA_MODULES=keystoneclient.middleware.auth_token
SOLUM_CONFIG_GENERATOR_EXTRA_MODULES=keystonemiddleware.auth_token