]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
If providers exist in neutron.conf, don't look in services conf
authorDoug Wiegley <dougw@a10networks.com>
Fri, 20 Feb 2015 21:54:03 +0000 (14:54 -0700)
committerDoug Wiegley <dougw@a10networks.com>
Tue, 24 Feb 2015 06:38:00 +0000 (23:38 -0700)
Certain tests still put providers into neutron.conf, and upgrade scenarios
will have more correct providers in neutron.conf than the new locations.
If we find providers in neutron.conf, use them in favor of the
split config files during the transition.

Closes-Bug: 1422895
Change-Id: I731f7c80c2df78fa521a5140e450972119f4a105

neutron/services/provider_configuration.py

index 2d9b456e861812fb4b6ae130b7d5a3a15685efb0..133d10b60c560a2c34a433fc2924ea769c34eeeb 100644 (file)
@@ -70,16 +70,25 @@ def parse_service_provider_opt():
             raise n_exc.Invalid(
                 _("Provider name is limited by 255 characters: %s") % name)
 
-    # Main neutron config file
+    # TODO(dougwig) - phase out the neutron.conf location for service
+    # providers a cycle or two after Kilo.
+
+    # Look in neutron.conf for service providers first (legacy mode)
     try:
         svc_providers_opt = cfg.CONF.service_providers.service_provider
     except cfg.NoSuchOptError:
         svc_providers_opt = []
 
-    # Add in entries from the *aas conf files
-    neutron_mods = repos.NeutronModules()
-    for x in neutron_mods.installed_list():
-        svc_providers_opt += neutron_mods.service_providers(x)
+    # Look in neutron-*aas.conf files for service provider configs
+    if svc_providers_opt:
+        LOG.warning(_LW("Reading service_providers from legacy location in "
+                        "neutron.conf, and ignoring values in "
+                        "neutron_*aas.conf files; this override will be "
+                        "going away soon."))
+    else:
+        neutron_mods = repos.NeutronModules()
+        for x in neutron_mods.installed_list():
+            svc_providers_opt += neutron_mods.service_providers(x)
 
     LOG.debug("Service providers = %s", svc_providers_opt)