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
This commit is contained in:
Jamie Lennox 2016-10-14 13:14:05 +11:00
parent a6d39e9ba2
commit 46ba1aa762
1 changed files with 7 additions and 5 deletions

View File

@ -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