From 6ff0b1512bae31fd30a2bca610f33a5a0eac467d Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Wed, 16 Jul 2014 12:28:50 +0400 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: I42ee04171e98518f8728af4996e687b8a46cd27c Closes-Bug: #1342274 --- etc/sahara/sahara.conf.sample | 2 +- requirements.txt | 1 + sahara/api/acl.py | 14 ++------------ tools/config/oslo.config.generator.rc | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/etc/sahara/sahara.conf.sample b/etc/sahara/sahara.conf.sample index b9680846..407d0cbf 100644 --- a/etc/sahara/sahara.conf.sample +++ b/etc/sahara/sahara.conf.sample @@ -582,7 +582,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. Deprecated, diff --git a/requirements.txt b/requirements.txt index f91953cb..b5b0da11 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ eventlet>=0.13.0 Flask>=0.10,<1.0 iso8601>=0.1.9 jsonschema>=2.0.0,<3.0.0 +keystonemiddleware>=1.0.0 lockfile>=0.8 oslo.config>=1.4.0.0a3 oslo.db>=0.4.0 # Apache-2.0 diff --git a/sahara/api/acl.py b/sahara/api/acl.py index 684af825..e404827e 100644 --- a/sahara/api/acl.py +++ b/sahara/api/acl.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from keystoneclient.middleware import auth_token +from keystonemiddleware import auth_token from oslo.config import cfg from sahara.openstack.common import log @@ -27,16 +27,6 @@ AUTH_OPT_GROUP_NAME = 'keystone_authtoken' AUTH_URI = None -def register_auth_opts(conf): - """Register keystoneclient auth_token middleware options.""" - - conf.register_opts(auth_token.opts, group=AUTH_OPT_GROUP_NAME) - auth_token.CONF = conf - - -register_auth_opts(CONF) - - def wrap(app, conf): """Wrap wsgi application with ACL check.""" @@ -45,6 +35,6 @@ def wrap(app, conf): # store auth uri in global var to be able to use it in runtime global AUTH_URI - AUTH_URI = auth_protocol.auth_uri + AUTH_URI = auth_protocol._identity_server.auth_uri return auth_protocol diff --git a/tools/config/oslo.config.generator.rc b/tools/config/oslo.config.generator.rc index aa13f708..8710da94 100644 --- a/tools/config/oslo.config.generator.rc +++ b/tools/config/oslo.config.generator.rc @@ -1,2 +1,2 @@ -export SAHARA_CONFIG_GENERATOR_EXTRA_MODULES="keystoneclient.middleware.auth_token" +export SAHARA_CONFIG_GENERATOR_EXTRA_MODULES="keystonemiddleware.auth_token" export SAHARA_CONFIG_GENERATOR_EXTRA_LIBRARIES="oslo.db oslo.messaging"