From 0f0b224f6d14a2679d5c0f298b01dead82be7bde Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Tue, 31 Jan 2012 14:40:26 -0600 Subject: 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 --- nova/api/openstack/wsgi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nova/api') 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, -- cgit