summaryrefslogtreecommitdiffstats
path: root/nova/context.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-29 22:48:08 +0000
committerGerrit Code Review <review@openstack.org>2012-02-29 22:48:08 +0000
commit873830948c19012931a5b220f7e7f1089149b538 (patch)
tree7b679f8230b1853a316747ec5a854d342e2a18bf /nova/context.py
parent07c85f5a835a93a2b4a828510a09adbc30505761 (diff)
parentff95c90f51d1d1e70a247cb7e94bb7cb757ac37d (diff)
downloadnova-873830948c19012931a5b220f7e7f1089149b538.tar.gz
nova-873830948c19012931a5b220f7e7f1089149b538.tar.xz
nova-873830948c19012931a5b220f7e7f1089149b538.zip
Merge "Ensure that context read_deleted is only one of 'no', 'yes' or 'only'"
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 []