summaryrefslogtreecommitdiffstats
path: root/nova/context.py
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-29 21:52:01 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-29 22:05:33 +0000
commitff95c90f51d1d1e70a247cb7e94bb7cb757ac37d (patch)
tree8e2bedb8f5b7381cae0bfbea7c997ce8054d9cfd /nova/context.py
parent3b241d2b5889f2bc8b9c05f205c4ff848375a508 (diff)
downloadnova-ff95c90f51d1d1e70a247cb7e94bb7cb757ac37d.tar.gz
nova-ff95c90f51d1d1e70a247cb7e94bb7cb757ac37d.tar.xz
nova-ff95c90f51d1d1e70a247cb7e94bb7cb757ac37d.zip
Ensure that context read_deleted is only one of 'no', 'yes' or 'only'
Fixes bug 942690 Change-Id: I1b1867062a8af7b3fb0eb575e6b9570a964cfefa
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/context.py b/nova/context.py
index 58deb1318..8ec4a30ec 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -48,6 +48,10 @@ class RequestContext(object):
:param overwrite: Set to False to ensure that the greenthread local
copy of the index is not overwritten.
"""
+ if read_deleted not in ('no', 'yes', 'only'):
+ raise ValueError(_("read_deleted can only be one of 'no', "
+ "'yes' or 'only', not %r") % read_deleted)
+
self.user_id = user_id
self.project_id = project_id
self.roles = roles or []