Don't configure on import
The keystone.config package called config.configure() at import- time. This will make it obvious that developers can't use config options at import-time because packages that do that will fail on import. Change-Id: I9306f67609d782e3f49fd43908448daf1287d51c Related-Bug: #1265108 Related-Bug: #1265670 Closes-Bug: #1269785
This commit is contained in:
parent
5e7b4809aa
commit
d542caa47e
@ -103,6 +103,7 @@ if __name__ == '__main__':
|
|||||||
if os.path.exists(dev_conf):
|
if os.path.exists(dev_conf):
|
||||||
config_files = [dev_conf]
|
config_files = [dev_conf]
|
||||||
|
|
||||||
|
config.configure()
|
||||||
sql.initialize()
|
sql.initialize()
|
||||||
|
|
||||||
CONF(project='keystone',
|
CONF(project='keystone',
|
||||||
|
@ -36,6 +36,7 @@ from keystone import service
|
|||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
|
||||||
|
config.configure()
|
||||||
sql.initialize()
|
sql.initialize()
|
||||||
|
|
||||||
CONF(project='keystone')
|
CONF(project='keystone')
|
||||||
|
@ -212,6 +212,7 @@ command_opt = cfg.SubCommandOpt('command',
|
|||||||
def main(argv=None, config_files=None):
|
def main(argv=None, config_files=None):
|
||||||
CONF.register_cli_opt(command_opt)
|
CONF.register_cli_opt(command_opt)
|
||||||
|
|
||||||
|
config.configure()
|
||||||
sql.initialize()
|
sql.initialize()
|
||||||
|
|
||||||
CONF(args=argv[1:],
|
CONF(args=argv[1:],
|
||||||
|
@ -22,7 +22,6 @@ from keystone import exception
|
|||||||
from keystone.openstack.common import log
|
from keystone.openstack.common import log
|
||||||
|
|
||||||
|
|
||||||
config.configure()
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
|
||||||
setup_authentication = config.setup_authentication
|
setup_authentication = config.setup_authentication
|
||||||
|
@ -70,6 +70,9 @@ from keystone import service
|
|||||||
from keystone.openstack.common import policy as common_policy # noqa
|
from keystone.openstack.common import policy as common_policy # noqa
|
||||||
|
|
||||||
|
|
||||||
|
config.configure()
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
TESTSDIR = os.path.dirname(os.path.abspath(__file__))
|
TESTSDIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..'))
|
ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..'))
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
# NOTE(dolph): please try to avoid additional fixtures if possible; test suite
|
# NOTE(dolph): please try to avoid additional fixtures if possible; test suite
|
||||||
# performance may be negatively affected.
|
# performance may be negatively affected.
|
||||||
|
|
||||||
from keystone import assignment
|
|
||||||
from keystone import config
|
from keystone import config
|
||||||
|
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_DOMAIN_ID = config.CONF.identity.default_domain_id
|
DEFAULT_DOMAIN_ID = 'default'
|
||||||
|
|
||||||
|
|
||||||
TENANTS = [
|
TENANTS = [
|
||||||
@ -104,8 +103,8 @@ ROLES = [
|
|||||||
'id': 'member',
|
'id': 'member',
|
||||||
'name': 'Member',
|
'name': 'Member',
|
||||||
}, {
|
}, {
|
||||||
'id': CONF.member_role_id,
|
'id': '9fe2ff9ee4384b1894a90878d3e92bab',
|
||||||
'name': CONF.member_role_name,
|
'name': '_member_',
|
||||||
}, {
|
}, {
|
||||||
'id': 'other',
|
'id': 'other',
|
||||||
'name': 'Other',
|
'name': 'Other',
|
||||||
@ -121,4 +120,9 @@ ROLES = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
DOMAINS = [assignment.calc_default_domain()]
|
DOMAINS = [{'description':
|
||||||
|
(u'Owns users and tenants (i.e. projects)'
|
||||||
|
' available on Identity API v2.'),
|
||||||
|
'enabled': True,
|
||||||
|
'id': DEFAULT_DOMAIN_ID,
|
||||||
|
'name': u'Default'}]
|
||||||
|
@ -30,7 +30,7 @@ from keystone.tests import rest
|
|||||||
|
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
DEFAULT_DOMAIN_ID = CONF.identity.default_domain_id
|
DEFAULT_DOMAIN_ID = 'default'
|
||||||
|
|
||||||
TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
|
TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user