Skip to content

Commit b0fd798

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add stub unified limits driver"
2 parents 1c20ee2 + 4fbe94a commit b0fd798

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)