summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-04-03 14:05:02 +0000
committerGerrit Code Review <review@openstack.org>2013-04-03 14:05:02 +0000
commit1ad8d1a749544c1710fe3bb911fb61df0317b105 (patch)
tree941303306ba041825523c49623f7ad7c6915393e /nova/api
parent22dd8b18474bbf5aea35ae67e1ab32164c68e127 (diff)
parente9e8b5314e6129099f0129d262ea9959aacbdfa4 (diff)
Merge "Explain why the give methods are whitelisted."
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 91eeef4b1..03674d767 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -60,6 +60,15 @@ _MEDIA_TYPE_MAP = {
'application/atom+xml': 'atom',
}
+# These are typically automatically created by routes as either defaults
+# collection or member methods.
+_ROUTES_METHODS = [
+ 'create',
+ 'delete',
+ 'show',
+ 'update',
+]
+
class Request(webob.Request):
"""Add some OpenStack API-specific logic to the base webob.Request."""
@@ -998,8 +1007,7 @@ class Resource(wsgi.Application):
meth = getattr(self.controller, action)
except AttributeError:
if (not self.wsgi_actions or
- action not in ['action', 'create', 'delete', 'update',
- 'show']):
+ action not in _ROUTES_METHODS + ['action']):
# Propagate the error
raise
else: