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
This commit is contained in:
@@ -152,6 +152,7 @@ import tempfile
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
|
from oslo.config import cfg
|
||||||
import six
|
import six
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
@@ -164,23 +165,6 @@ from keystoneclient.openstack.common import timeutils
|
|||||||
from keystoneclient import utils
|
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
|
# alternative middleware configuration in the main application's
|
||||||
# configuration file e.g. in nova.conf
|
# configuration file e.g. in nova.conf
|
||||||
# [keystone_authtoken]
|
# [keystone_authtoken]
|
||||||
@@ -197,6 +181,7 @@ if not CONF:
|
|||||||
# 'swift.cache' key. However it could be different, depending on deployment.
|
# 'swift.cache' key. However it could be different, depending on deployment.
|
||||||
# To use Swift memcache, you must set the 'cache' option to the environment
|
# To use Swift memcache, you must set the 'cache' option to the environment
|
||||||
# key where the Swift cache object is stored.
|
# key where the Swift cache object is stored.
|
||||||
|
|
||||||
opts = [
|
opts = [
|
||||||
cfg.StrOpt('auth_admin_prefix',
|
cfg.StrOpt('auth_admin_prefix',
|
||||||
default='',
|
default='',
|
||||||
@@ -310,6 +295,8 @@ opts = [
|
|||||||
' token binding is needed to be allowed. Finally the name of a'
|
' token binding is needed to be allowed. Finally the name of a'
|
||||||
' binding method that must be present in tokens.'),
|
' binding method that must be present in tokens.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
CONF.register_opts(opts, group='keystone_authtoken')
|
CONF.register_opts(opts, group='keystone_authtoken')
|
||||||
|
|
||||||
LIST_OF_VERSIONS_TO_ATTEMPT = ['v2.0', 'v3.0']
|
LIST_OF_VERSIONS_TO_ATTEMPT = ['v2.0', 'v3.0']
|
||||||
|
Reference in New Issue
Block a user