Merge "Reference DEFAULT_SERVICETYPE OptGoup names in lowercase"
This commit is contained in:
commit
abb25dad09
@ -283,7 +283,7 @@ notification_topics = notifications
|
||||
# default driver to use for quota checks
|
||||
# quota_driver = quantum.quota.ConfDriver
|
||||
|
||||
[DEFAULT_SERVICETYPE]
|
||||
[default_servicetype]
|
||||
# Description of the default service type (optional)
|
||||
# description = "default service type"
|
||||
# Enter a service definition line for each advanced service provided
|
||||
|
@ -43,13 +43,13 @@ default_servicetype_opts = [
|
||||
'using the format: <service>:<plugin>[:<driver>]'))
|
||||
]
|
||||
|
||||
cfg.CONF.register_opts(default_servicetype_opts, 'DEFAULT_SERVICETYPE')
|
||||
cfg.CONF.register_opts(default_servicetype_opts, 'default_servicetype')
|
||||
|
||||
|
||||
def parse_service_definition_opt():
|
||||
"""Parse service definition opts and returns result."""
|
||||
results = []
|
||||
svc_def_opt = cfg.CONF.DEFAULT_SERVICETYPE.service_definition
|
||||
svc_def_opt = cfg.CONF.default_servicetype.service_definition
|
||||
try:
|
||||
for svc_def_str in svc_def_opt:
|
||||
split = svc_def_str.split(':')
|
||||
@ -72,7 +72,7 @@ def parse_service_definition_opt():
|
||||
class NoDefaultServiceDefinition(q_exc.QuantumException):
|
||||
message = _("No default service definition in configuration file. "
|
||||
"Please add service definitions using the service_definition "
|
||||
"variable in the [DEFAULT_SERVICETYPE] section")
|
||||
"variable in the [default_servicetype] section")
|
||||
|
||||
|
||||
class ServiceTypeNotFound(q_exc.NotFound):
|
||||
@ -129,12 +129,12 @@ class ServiceTypeManager(object):
|
||||
self._initialize_db()
|
||||
ctx = context.get_admin_context()
|
||||
# Init default service type from configuration file
|
||||
svc_defs = cfg.CONF.DEFAULT_SERVICETYPE.service_definition
|
||||
svc_defs = cfg.CONF.default_servicetype.service_definition
|
||||
if not svc_defs:
|
||||
raise NoDefaultServiceDefinition()
|
||||
def_service_type = {'name': DEFAULT_SVCTYPE_NAME,
|
||||
'description':
|
||||
cfg.CONF.DEFAULT_SERVICETYPE.description,
|
||||
cfg.CONF.default_servicetype.description,
|
||||
'service_definitions':
|
||||
parse_service_definition_opt(),
|
||||
'default': True}
|
||||
|
@ -25,7 +25,7 @@ lock_path = $state_path/lock
|
||||
[DATABASE]
|
||||
sql_connection = 'sqlite:///:memory:'
|
||||
|
||||
[DEFAULT_SERVICETYPE]
|
||||
[default_servicetype]
|
||||
description = "default service type"
|
||||
service_definition=dummy:quantum.tests.unit.dummy_plugin.QuantumDummyPlugin
|
||||
|
||||
|
@ -252,7 +252,7 @@ class ServiceTypeManagerTestCase(ServiceTypeTestCaseBase):
|
||||
servicetype_db.ServiceTypeManager._instance = None
|
||||
plugin_name = "%s.%s" % (dp.__name__, dp.DummyServicePlugin.__name__)
|
||||
cfg.CONF.set_override('service_definition', ['dummy:%s' % plugin_name],
|
||||
group='DEFAULT_SERVICETYPE')
|
||||
group='default_servicetype')
|
||||
self.addCleanup(db_api.clear_db)
|
||||
super(ServiceTypeManagerTestCase, self).setUp()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user