diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2013-04-02 17:10:43 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2013-04-02 17:10:43 -0700 |
| commit | e9e8b5314e6129099f0129d262ea9959aacbdfa4 (patch) | |
| tree | d3a7ea4849cfeb0c8606cdffbcd6fdac5bcbc40f /nova/api | |
| parent | 7bf541cc907bd0e4c881a1bdbd6a14fd7146a5f9 (diff) | |
| download | nova-e9e8b5314e6129099f0129d262ea9959aacbdfa4.tar.gz nova-e9e8b5314e6129099f0129d262ea9959aacbdfa4.tar.xz nova-e9e8b5314e6129099f0129d262ea9959aacbdfa4.zip | |
Explain why the give methods are whitelisted.
In order to aid mine (and likely others) understanding of this
code it seems to make sense to document what these special whitelisted
attributes are.
Change-Id: I1c11484fc74e898df5d25ab94ed0cdb288accd67
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 12 |
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: |
