diff options
author | melanie witt <melwittt@gmail.com> | 2017-11-29 23:51:11 +0000 |
---|---|---|
committer | melanie witt <melwittt@gmail.com> | 2017-12-08 22:11:24 +0000 |
commit | 4d3bd3313467b36d89a28004d4be9a6c98379ef5 (patch) | |
tree | 7e008aa6f5562a854c7cd809852620e8e429a8fc /nova/quota.py | |
parent | 93ceb7fb5e3cc8112a314ae19fe63ffe3481a6ce (diff) | |
download | nova-4d3bd3313467b36d89a28004d4be9a6c98379ef5.tar.gz |
Follow up on removing old-style quotas code
This is a follow up to another patch [1] that removed the old-style
quotas code which is no longer in use. Here, we remove the 'reserved'
key from quotas internally and set it in the APIs where it's expected.
We also remove code that accesses the quota_usages and reservations
tables as they're no longer used.
[1] https://review.openstack.org/#/c/511689
Change-Id: I75291571468ddb79b7561810de0953bb462548e3
Diffstat (limited to 'nova/quota.py')
-rw-r--r-- | nova/quota.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/quota.py b/nova/quota.py index 44c354bbd7..b353be21bc 100644 --- a/nova/quota.py +++ b/nova/quota.py @@ -136,7 +136,6 @@ class DbQuotaDriver(object): usage = usages.get(resource.name, {}) modified_quotas[resource.name].update( in_use=usage.get('in_use', 0), - reserved=0, ) # Initialize remains quotas with the default limits. @@ -710,7 +709,6 @@ class NoopQuotaDriver(object): quotas[resource.name]['limit'] = -1 if usages: quotas[resource.name]['in_use'] = -1 - quotas[resource.name]['reserved'] = -1 if remains: quotas[resource.name]['remains'] = -1 return quotas @@ -1241,6 +1239,11 @@ class QuotaEngine(object): def resources(self): return sorted(self._resources.keys()) + def get_reserved(self): + if isinstance(self._driver, NoopQuotaDriver): + return -1 + return 0 + def _keypair_get_count_by_user(context, user_id): count = objects.KeyPairList.get_count_by_user(context, user_id) |