diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2012-01-31 14:40:26 -0600 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2012-01-31 14:40:26 -0600 |
| commit | 0f0b224f6d14a2679d5c0f298b01dead82be7bde (patch) | |
| tree | 5d9fe85fa87cf411f4c171f000b36dbddb53e71a /nova/api | |
| parent | c9ac6e1671df689c3ba4a4d55f8740bd8f2e8f0e (diff) | |
Allow for auditing of API calls.
Splits Resource.__call__() into two parts to allow for easy auditing
of the API stack--checking execution times, etc. No behavior change
or execution time impact should be expected.
Change-Id: If9629e8b85f490c66499c42d6f6977a09d641c22
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 50f693f49..af62f9b28 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -777,6 +777,18 @@ class Resource(wsgi.Application): content_type, body = self.get_body(request) accept = request.best_match_content_type() + # NOTE(Vek): Splitting the function up this way allows for + # auditing by external tools that wrap the existing + # function. If we try to audit __call__(), we can + # run into troubles due to the @webob.dec.wsgify() + # decorator. + return self._process_stack(request, action, action_args, + content_type, body, accept) + + def _process_stack(self, request, action, action_args, + content_type, body, accept): + """Implement the processing stack.""" + # Get the implementing method try: meth, extensions = self.get_method(request, action, |
