From 93f3cd75e1c55c8e21afc03e338345443bd4ebf5 Mon Sep 17 00:00:00 2001 From: chioleong Date: Mon, 21 Jul 2014 17:23:01 -0700 Subject: [PATCH] Use auth_token from keystonemiddleware auth_token middleware in python-keystoneclient is deprecated and has been moved to the keystonemiddleware repo. Change-Id: I174b62d035b84aff1cf0d60efb84f7650445f42c Closes-Bug: #1342274 --- etc/marconi.conf.sample | 2 +- requirements-py3.txt | 2 +- requirements.txt | 2 +- tools/config/oslo.config.generator.rc | 2 +- zaqar/queues/transport/auth.py | 14 +++++++++++--- zaqar/tests/queues/transport/wsgi/v1/test_auth.py | 2 +- .../tests/queues/transport/wsgi/v1_1/test_auth.py | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/etc/marconi.conf.sample b/etc/marconi.conf.sample index a8cc0576e..9b4856a5e 100644 --- a/etc/marconi.conf.sample +++ b/etc/marconi.conf.sample @@ -226,7 +226,7 @@ [keystone_authtoken] # -# Options defined in keystoneclient.middleware.auth_token +# Options defined in keystonemiddleware.auth_token # # Prefix to prepend at the beginning of the path (string diff --git a/requirements-py3.txt b/requirements-py3.txt index 3711aedbd..e07ecb5e0 100644 --- a/requirements-py3.txt +++ b/requirements-py3.txt @@ -5,10 +5,10 @@ netaddr>=0.7.6 falcon>=0.1.6,<0.2.0 jsonschema>=2.0.0,<3.0.0 iso8601>=0.1.9 +keystonemiddleware>=1.0.0 msgpack-python>=0.4.0 posix_ipc pymongo>=2.5 -python-keystoneclient>=0.10.0 # python-memcached has no Py3k support for now # python-memcached>=1.48 WebOb>=1.2.3 diff --git a/requirements.txt b/requirements.txt index 512bca144..1f0331a2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,10 +5,10 @@ netaddr>=0.7.6 falcon>=0.1.6,<0.2.0 jsonschema>=2.0.0,<3.0.0 iso8601>=0.1.9 +keystonemiddleware>=1.0.0 msgpack-python>=0.4.0 posix_ipc pymongo>=2.5 -python-keystoneclient>=0.10.0 python-memcached>=1.48 WebOb>=1.2.3 stevedore>=0.14 diff --git a/tools/config/oslo.config.generator.rc b/tools/config/oslo.config.generator.rc index 8f7666346..35b71ce99 100644 --- a/tools/config/oslo.config.generator.rc +++ b/tools/config/oslo.config.generator.rc @@ -1,4 +1,4 @@ -export OSLO_CONFIG_GENERATOR_EXTRA_MODULES="keystoneclient.middleware.auth_token" +export OSLO_CONFIG_GENERATOR_EXTRA_MODULES="keystonemiddleware.auth_token" export OSLO_CONFIG_GENERATOR_EXTRA_LIBRARIES="zaqar.bootstrap zaqar.storage.base zaqar.storage.pipeline diff --git a/zaqar/queues/transport/auth.py b/zaqar/queues/transport/auth.py index c4da41b28..87858f43d 100644 --- a/zaqar/queues/transport/auth.py +++ b/zaqar/queues/transport/auth.py @@ -15,7 +15,8 @@ """Middleware for handling authorization and authentication.""" -from keystoneclient.middleware import auth_token +from keystonemiddleware import auth_token +from keystonemiddleware import opts from zaqar.openstack.common import log @@ -31,10 +32,17 @@ class KeystoneAuth(object): @classmethod def _register_opts(cls, conf): - """Register keystoneclient middleware options.""" + """Register keystonemiddleware options.""" + + options = [] + keystone_opts = opts.list_auth_token_opts() + for n in keystone_opts: + if (n[0] == cls.OPT_GROUP_NAME): + options = n[1] + break if cls.OPT_GROUP_NAME not in conf: - conf.register_opts(auth_token.opts, group=cls.OPT_GROUP_NAME) + conf.register_opts(options, group=cls.OPT_GROUP_NAME) auth_token.CONF = conf @classmethod diff --git a/zaqar/tests/queues/transport/wsgi/v1/test_auth.py b/zaqar/tests/queues/transport/wsgi/v1/test_auth.py index f4648b062..77773419b 100644 --- a/zaqar/tests/queues/transport/wsgi/v1/test_auth.py +++ b/zaqar/tests/queues/transport/wsgi/v1/test_auth.py @@ -18,7 +18,7 @@ import uuid import falcon from falcon import testing -from keystoneclient.middleware import auth_token +from keystonemiddleware import auth_token from zaqar.tests.queues.transport.wsgi import base diff --git a/zaqar/tests/queues/transport/wsgi/v1_1/test_auth.py b/zaqar/tests/queues/transport/wsgi/v1_1/test_auth.py index 7c22a4b98..3b53b152a 100644 --- a/zaqar/tests/queues/transport/wsgi/v1_1/test_auth.py +++ b/zaqar/tests/queues/transport/wsgi/v1_1/test_auth.py @@ -18,7 +18,7 @@ import uuid import falcon from falcon import testing -from keystoneclient.middleware import auth_token +from keystonemiddleware import auth_token from zaqar.tests.queues.transport.wsgi import base