]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Reference DEFAULT_SERVICETYPE OptGoup names in lowercase
authorZhongyue Luo <zhongyue.nah@intel.com>
Sat, 18 May 2013 13:52:15 +0000 (21:52 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Sat, 18 May 2013 13:53:59 +0000 (21:53 +0800)
To have consistent option group name format across projects,
oslo.config now normalizes all non lowercase group names to lowercase
when loading conf files.
Thus conf files are backwards compatible but option group references
in the code must now use lowercase before we update oslo.config.

This patch replaces all 'DEFAULT_SERVICETYPE' references to
'default_servicetype'

Change-Id: Iccab055c4664e11c9618706e594416194065048b

etc/quantum.conf
quantum/db/servicetype_db.py
quantum/tests/etc/quantum.conf.test
quantum/tests/unit/test_servicetype.py

index 095d1e9d4a25648fbcc562cf05a70e3838759c53..93291e6bdcfd1efcf90a526730d0076f521144c9 100644 (file)
@@ -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
index 1fa1e5cb0df3382f4adaab364008ae58081eafa8..db9417eb8ab06799ba08399ddf7838a92cb3bcc6 100644 (file)
@@ -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}
index cedeb3c2788e5dd188f95325106b8596365aa355..c6c0eb79dfa4d0e78d24c803a5fd08b11782a13b 100644 (file)
@@ -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
 
index 670a544755a74a4d38a116d6694931fb77001e2b..2b6fd3a81b5533e49cbbf10d3ae45e6c57e404a5 100644 (file)
@@ -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()