Skip to content

Commit 4fbe94a

Browse files
JohnGarbuttmelwitt
authored andcommitted
Add stub unified limits driver
The unified limits driver is starting with the noop driver. This gives us the closest API behaviour to what we describe in the spec. The Unified Limits quota driver will has several purposes: * stop all existing quota enforcement, so we can replace it * stop checking the database for quota info * make the API do what it does today with the noop driver enabled The next few patches will assert the existing API behaviour with the unified limits quota driver. This is the exact same thing that happens today when you enable the noop driver. As we add back limits, using the new unified limits approach, we will update the API so users are informed about what limits are actually being enforced. blueprint unified-limits-nova Change-Id: Iab152a6b2bb58454c32889390ec9add43771fa62
1 parent 78f02e9 commit 4fbe94a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

nova/quota.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,19 @@ def limit_check_project_and_user(self, context, resources,
768768
pass
769769

770770

771+
class UnifiedLimitsDriver(NoopQuotaDriver):
772+
"""Ease migration to new unified limits code.
773+
774+
Help ease migration to unified limits by ensuring the old code
775+
paths still work with unified limits. Eventually the expectation is
776+
all this legacy quota code will go away, leaving the new simpler code
777+
"""
778+
779+
def __init__(self):
780+
LOG.warning("The Unified Limits Quota Driver is experimental and "
781+
"is under active development. Do not use this driver.")
782+
783+
771784
class BaseResource(object):
772785
"""Describe a single resource for quota checking."""
773786

nova/tests/unit/test_quota.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,12 @@ def test_get_settable_quotas_without_user(self):
18711871
self.assertEqual(self.expected_settable_quotas, result)
18721872

18731873

1874+
class UnifiedLimitsDriverTestCase(NoopQuotaDriverTestCase):
1875+
def setUp(self):
1876+
super(UnifiedLimitsDriverTestCase, self).setUp()
1877+
self.driver = quota.UnifiedLimitsDriver()
1878+
1879+
18741880
@ddt.ddt
18751881
class QuotaCountTestCase(test.NoDBTestCase):
18761882
@mock.patch('nova.scheduler.client.report.SchedulerReportClient.'

0 commit comments

Comments
 (0)