From 09a2111c59c5c56a2b8d2c9f5269238d182716f0 Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Thu, 27 Feb 2014 15:25:48 +1000 Subject: [PATCH] Rely on OSLO.config OSLO.config is now used by all the services. The hack in place to correctly find the right config file is apparently (by way of the comments) only required for the gate. Therefore we should be able to remove this. Change-Id: If5c5d5a4711de21624b2e75e99cc785520ab6aba --- keystoneclient/middleware/auth_token.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/keystoneclient/middleware/auth_token.py b/keystoneclient/middleware/auth_token.py index a6360d878..ccab95464 100644 --- a/keystoneclient/middleware/auth_token.py +++ b/keystoneclient/middleware/auth_token.py @@ -152,6 +152,7 @@ import tempfile import time import netaddr +from oslo.config import cfg import six from six.moves import urllib @@ -164,23 +165,6 @@ from keystoneclient.openstack.common import timeutils from keystoneclient import utils -CONF = None -# to pass gate before oslo-config is deployed everywhere, -# try application copies first -for app in 'nova', 'glance', 'quantum', 'cinder': - try: - cfg = __import__('%s.openstack.common.cfg' % app, - fromlist=['%s.openstack.common' % app]) - # test which application middleware is running in - if hasattr(cfg, 'CONF') and 'config_file' in cfg.CONF: - CONF = cfg.CONF - break - except ImportError: - pass -if not CONF: - from oslo.config import cfg - CONF = cfg.CONF - # alternative middleware configuration in the main application's # configuration file e.g. in nova.conf # [keystone_authtoken] @@ -197,6 +181,7 @@ if not CONF: # 'swift.cache' key. However it could be different, depending on deployment. # To use Swift memcache, you must set the 'cache' option to the environment # key where the Swift cache object is stored. + opts = [ cfg.StrOpt('auth_admin_prefix', default='', @@ -310,6 +295,8 @@ opts = [ ' token binding is needed to be allowed. Finally the name of a' ' binding method that must be present in tokens.'), ] + +CONF = cfg.CONF CONF.register_opts(opts, group='keystone_authtoken') LIST_OF_VERSIONS_TO_ATTEMPT = ['v2.0', 'v3.0']