diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-01-28 17:15:26 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-28 17:15:26 +0000 |
| commit | 18708b18a73b75dbe82583b402e9d310dd135057 (patch) | |
| tree | fe62394192cd62cd41652cc9a865a6ddb8c589ae /nova/api | |
| parent | d6d8cb79eab13df989011cabc39cb977a9a5fba0 (diff) | |
| parent | fa52cb09b2270876c9d9a03106f961be6c9db834 (diff) | |
Merge "Strip out Traceback from HTTP response"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 8b593d742..a6f255081 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -1182,10 +1182,18 @@ class Fault(webob.exc.HTTPException): # Replace the body with fault details. code = self.wrapped_exc.status_int fault_name = self._fault_names.get(code, "computeFault") + explanation = self.wrapped_exc.explanation + offset = explanation.find("Traceback") + if offset is not -1: + LOG.debug(_("API request failed, fault raised to the top of" + " the stack. Detailed stacktrace %s") % + explanation) + explanation = explanation[0:offset - 1] + fault_data = { fault_name: { 'code': code, - 'message': self.wrapped_exc.explanation}} + 'message': explanation}} if code == 413: retry = self.wrapped_exc.headers.get('Retry-After', None) if retry: |
