From ff73054e8637f29737cc65dc84ef0f9aea9d5abd Mon Sep 17 00:00:00 2001 From: Hong Hui Xiao Date: Mon, 20 Jun 2016 09:46:21 +0000 Subject: [PATCH] Remove the deprecated config "quota_items" It was deprecated at [1], and quota of resource will be registered at initialization of APIRouter. So, no need to use the config now. [1] https://review.openstack.org/#/c/181593 DocImpact: All references of 'quota_items' configuration option and its description should be removed from the docs. UpgradeImpact: Remove 'quota_items' configuration option from neutron.conf file. Change-Id: I0698772a49f51d7c65f1f4cf1ea7660cd07113a0 Closes-Bug: #1593772 --- neutron/conf/quota.py | 7 ------- neutron/quota/__init__.py | 13 ------------- neutron/tests/unit/extensions/test_quotasv2.py | 5 ----- .../notes/remove-quota_items-d50b4672dd31ea3e.yaml | 8 ++++++++ 4 files changed, 8 insertions(+), 25 deletions(-) create mode 100644 releasenotes/notes/remove-quota_items-d50b4672dd31ea3e.yaml diff --git a/neutron/conf/quota.py b/neutron/conf/quota.py index a4d68c1c28a..fcbff658633 100644 --- a/neutron/conf/quota.py +++ b/neutron/conf/quota.py @@ -21,19 +21,12 @@ from neutron._i18n import _ QUOTA_DB_MODULE = 'neutron.db.quota.driver' QUOTA_DB_DRIVER = '%s.DbQuotaDriver' % QUOTA_DB_MODULE QUOTA_CONF_DRIVER = 'neutron.quota.ConfDriver' -default_quota_items = ['network', 'subnet', 'port'] QUOTAS_CFG_GROUP = 'QUOTAS' # quota_opts from neutron/quota/__init__.py # renamed quota_opts to core_quota_opts core_quota_opts = [ - cfg.ListOpt('quota_items', - default=default_quota_items, - deprecated_for_removal=True, - help=_('Resource name(s) that are supported in quota ' - 'features. This option is now deprecated for ' - 'removal.')), cfg.IntOpt('default_quota', default=-1, help=_('Default number of resource allowed per tenant. ' diff --git a/neutron/quota/__init__.py b/neutron/quota/__init__.py index 018954c1365..7a535d312d6 100644 --- a/neutron/quota/__init__.py +++ b/neutron/quota/__init__.py @@ -34,7 +34,6 @@ LOG = logging.getLogger(__name__) QUOTA_DB_MODULE = quota.QUOTA_DB_MODULE QUOTA_DB_DRIVER = quota.QUOTA_DB_DRIVER QUOTA_CONF_DRIVER = quota.QUOTA_CONF_DRIVER -default_quota_items = quota.default_quota_items # Register the configuration options @@ -280,15 +279,3 @@ class QuotaEngine(object): QUOTAS = QuotaEngine.get_instance() - - -def register_resources_from_config(): - # This operation is now deprecated. All the neutron core and extended - # resource for which quota limits are enforced explicitly register - # themselves with the quota engine. - for resource_item in (set(cfg.CONF.QUOTAS.quota_items) - - set(default_quota_items)): - resource_registry.register_resource_by_name(resource_item) - - -register_resources_from_config() diff --git a/neutron/tests/unit/extensions/test_quotasv2.py b/neutron/tests/unit/extensions/test_quotasv2.py index 6b81492e3ca..402fd381683 100644 --- a/neutron/tests/unit/extensions/test_quotasv2.py +++ b/neutron/tests/unit/extensions/test_quotasv2.py @@ -55,12 +55,7 @@ class QuotaExtensionTestCase(testlib_api.WebTestCase): # Update the plugin and extensions path self.setup_coreplugin(TARGET_PLUGIN) - cfg.CONF.set_override( - 'quota_items', - ['network', 'subnet', 'port', 'extra1'], - group='QUOTAS') quota.QUOTAS = quota.QuotaEngine() - quota.register_resources_from_config() self._plugin_patcher = mock.patch(TARGET_PLUGIN, autospec=True) self.plugin = self._plugin_patcher.start() self.plugin.return_value.supported_extension_aliases = ['quotas'] diff --git a/releasenotes/notes/remove-quota_items-d50b4672dd31ea3e.yaml b/releasenotes/notes/remove-quota_items-d50b4672dd31ea3e.yaml new file mode 100644 index 00000000000..34006094898 --- /dev/null +++ b/releasenotes/notes/remove-quota_items-d50b4672dd31ea3e.yaml @@ -0,0 +1,8 @@ +--- +prelude: > + Remove 'quota_items' configuration option from + neutron.conf file. This option was deprecated since + Liberty release and has no effect now. +upgrade: + - Remove 'quota_items' configuration option from + neutron.conf file.