From 46ba1aa762737daee26e35a45eaa87e3a427521a Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Fri, 14 Oct 2016 13:14:05 +1100 Subject: [PATCH] Only emit deprecation warning when deprecated value read If providers is not found in the CONF.service_providers.service_provider it looks them up from implicit conf files. If nothing is defined there it still emits a deprecation warning. Maybe a warning should be emitted if this value is empty, however the deprecation warning that is provided is incorrect and misleading. Change-Id: I3166a445b69d854b294843814a081e74c1aadb3b Closes-Bug: #1633293 --- neutron/services/provider_configuration.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/neutron/services/provider_configuration.py b/neutron/services/provider_configuration.py index ed38f825f44..ff1d68b875a 100644 --- a/neutron/services/provider_configuration.py +++ b/neutron/services/provider_configuration.py @@ -114,13 +114,15 @@ class NeutronModule(object): # necessary, if modules are loaded on the fly (DevStack may # be an example) if not providers: - versionutils.report_deprecated_feature( - LOG, - _LW('Implicit loading of service providers from ' - 'neutron_*.conf files is deprecated and will be removed ' - 'in Ocata release.')) providers = self.ini().service_providers.service_provider + if providers: + versionutils.report_deprecated_feature( + LOG, + _LW('Implicit loading of service providers from ' + 'neutron_*.conf files is deprecated and will be ' + 'removed in Ocata release.')) + return providers