summaryrefslogtreecommitdiffstats
path: root/nova/context.py
diff options
context:
space:
mode:
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>2012-03-13 17:13:02 -0500
committerKevin L. Mitchell <kevin.mitchell@rackspace.com>2012-03-20 10:42:07 -0500
commit6a38b650c001ec8e6da435856c37a28737401aaf (patch)
tree2be2d801cfdb17d14a3239a65f35f52514dcb731 /nova/context.py
parentde6fdec71055daa97fdc0d8e33cd643817b06c25 (diff)
downloadnova-6a38b650c001ec8e6da435856c37a28737401aaf.tar.gz
nova-6a38b650c001ec8e6da435856c37a28737401aaf.tar.xz
nova-6a38b650c001ec8e6da435856c37a28737401aaf.zip
Implement quota classes.
Allows entire classes of quotas to be associated with projects, which makes it easier to set specific quotas across multiple projects. TODO: * (?) Adding a mapping between projects and quota classes Change-Id: I6b6477481187d16af225d33c1989430e4071d5a8
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/context.py b/nova/context.py
index cab8b2d4b..78dca3ffc 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -42,7 +42,8 @@ class RequestContext(object):
def __init__(self, user_id, project_id, is_admin=None, read_deleted="no",
roles=None, remote_address=None, timestamp=None,
- request_id=None, auth_token=None, overwrite=True, **kwargs):
+ request_id=None, auth_token=None, overwrite=True,
+ quota_class=None, **kwargs):
"""
:param read_deleted: 'no' indicates deleted records are hidden, 'yes'
indicates deleted records are visible, 'only' indicates that
@@ -80,6 +81,7 @@ class RequestContext(object):
request_id = generate_request_id()
self.request_id = request_id
self.auth_token = auth_token
+ self.quota_class = quota_class
if overwrite or not hasattr(local.store, 'context'):
self.update_store()
@@ -95,7 +97,8 @@ class RequestContext(object):
'remote_address': self.remote_address,
'timestamp': utils.strtime(self.timestamp),
'request_id': self.request_id,
- 'auth_token': self.auth_token}
+ 'auth_token': self.auth_token,
+ 'quota_class': self.quota_class}
@classmethod
def from_dict(cls, values):