Deprecate NestedDbQuotaDriver for nested quotas

This driver does not appear to be used and all projects will be
switching over to the keystone supported unified limits quota mechanism.
To prepare for switching quota handling to this new code, we want to
deprecate the driver now so we can remove the code and not need to
refactor it into the new handling.

Change-Id: I56fc03affc9c2c47cbc0e38a66aa8b86f56d1499
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2019-05-06 20:32:47 -05:00
parent 0101834659
commit 8fbfe923bd
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
6 changed files with 62 additions and 0 deletions

View File

@ -131,12 +131,33 @@ class Checks(uc.UpgradeCommands):
return uc.Result(SUCCESS)
def _check_nested_quota(self):
"""Checks for the use of the nested quota driver.
The NestedDbQuotaDriver is deprecated in the Train release to prepare
for upcoming unified limits changes.
"""
# We import here to avoid conf loading order issues with cinder.service
# above.
import cinder.quota # noqa
quota_driver = CONF.quota_driver
if quota_driver == 'cinder.quota.NestedDbQuotaDriver':
return uc.Result(
WARNING,
'The NestedDbQuotaDriver has been deprecated. It will '
'continue to work in the 15.0.0 (Train) release, but will be '
'removed in 16.0.0')
return uc.Result(SUCCESS)
_upgrade_checks = (
# added in Stein
('Backup Driver Path', _check_backup_module),
('Use of Policy File', _check_policy_file),
# added in Train
('Periodic Interval Use', _check_periodic_interval),
('Use of Nest Quota Driver', _check_nested_quota),
)

View File

@ -452,6 +452,12 @@ class DbQuotaDriver(object):
class NestedDbQuotaDriver(DbQuotaDriver):
def __init__(self, *args, **kwargs):
super(NestedDbQuotaDriver, self).__init__(*args, **kwargs)
LOG.warning('The NestedDbQuotaDriver is deprecated and will be '
'removed in the "U" release.')
def validate_nested_setup(self, ctxt, resources, project_tree,
fix_allocated_quotas=False):
"""Ensures project_tree has quotas that make sense as nested quotas.

View File

@ -12,6 +12,7 @@
"""Unit tests for the cinder-status CLI interfaces."""
import ddt
import mock
from oslo_config import cfg
from oslo_upgradecheck import upgradecheck as uc
@ -22,6 +23,7 @@ from cinder.cmd import status
CONF = cfg.CONF
@ddt.ddt
class TestCinderStatus(testtools.TestCase):
"""Test cases for the cinder-status upgrade check command."""
@ -109,3 +111,15 @@ class TestCinderStatus(testtools.TestCase):
self.assertEqual(uc.Code.WARNING, result.code)
self.assertIn('New configuration options have been introduced',
result.details)
@ddt.data(['cinder.quota.DbQuotaDriver', True],
['cinder.quota.NestedDbQuotaDriver', False])
@ddt.unpack
def test_nested_quota_driver(self, driver, should_pass):
self._set_config('quota_driver', driver)
result = self.checks._check_nested_quota()
if should_pass:
expected = uc.Code.SUCCESS
else:
expected = uc.Code.WARNING
self.assertEqual(expected, result.code)

View File

@ -95,6 +95,7 @@ Upgrade
* Check added to make operators aware of new finer-grained configuration
options affecting the periodicity of various Cinder tasks. Triggered
when the the ``periodic_interval`` option is not set to its default value.
* Added check for use of deprecated ``cinder.quota.NestedDbQuotaDriver``.
See Also
========

View File

@ -2,6 +2,13 @@
Nested quotas
=============
.. warning::
The current nested quota driver is deprecated in the Cinder "Train" release
and will be removed. Configuration for handling nested project quotas will
change in a future release.
Nested quota is a change in how OpenStack services (such as Block Storage and
Compute) handle their quota resources by being hierarchy-aware. The main
reason for this change is to fully appreciate the hierarchical multi-tenancy

View File

@ -0,0 +1,13 @@
---
upgrade:
- |
A new check is added to the ``cinder-status upgrade check`` CLI to check
for the use of the deprecated ``cinder.quota.NestedDbQuotaDriver``. This
driver will be replaced by a new, OpenStack-wide, nested quota management.
deprecations:
- |
The ``cinder.quota.NestedDbQuotaDriver`` quota driver for handling nested
projects is now deprecated. There is an OpenStack-wide effort to move to
"unified limits" that will require changes in how quotas are handled for
these types of configurations. The ``NestedDbQuotaDriver`` will continue
to work until it is replaced with this new mechanism.