Warn OPENSTACK_QUANTUM_NETWORK setting as deprecated

Change-Id: If2f762fe665b9a88153a77a658f52bcd56185c53
Closes-Bug: #1377498
(cherry picked from commit 530e5fee78)
This commit is contained in:
Akihiro Motoki 2014-10-05 03:53:51 +09:00 committed by Thierry Carrez
parent 9b0ba951c0
commit f1a8abb925
1 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@ from __future__ import absolute_import
import collections
import logging
import warnings
import netaddr
@ -936,6 +937,12 @@ def is_extension_supported(request, extension_alias):
def is_enabled_by_config(name, default=True):
if hasattr(settings, 'OPENSTACK_QUANTUM_NETWORK'):
warnings.warn(
'OPENSTACK_QUANTUM_NETWORK setting is deprecated and will be '
'removed in the near future. '
'Please use OPENSTACK_NEUTRON_NETWORK instead.',
DeprecationWarning)
network_config = (getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {}) or
getattr(settings, 'OPENSTACK_QUANTUM_NETWORK', {}))
return network_config.get(name, default)