]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove Quota Exception Stack Traces from Cinder Logs
authorRahul Verma <rahul.verma@hp.com>
Tue, 3 Jun 2014 22:26:48 +0000 (15:26 -0700)
committerRahul Verma <rahul.verma@hp.com>
Tue, 3 Jun 2014 22:59:16 +0000 (15:59 -0700)
Added an if clause to the Cinder API FaultWrapper so that
a warning is printed rather than an error and stack trace
if an exception of type QuotaError is thrown.

Closes-Bug: 1324294
Change-Id: If91db0f443afc212af3893e27dd36f19b15c43bf

cinder/api/middleware/fault.py

index 020b769064408b5268bc568fefbf00f19938d05d..dd1566d42ff1a0630631397da54a57e674c786e0 100644 (file)
@@ -41,8 +41,8 @@ class FaultWrapper(base_wsgi.Middleware):
             status, webob.exc.HTTPInternalServerError)()
 
     def _error(self, inner, req):
-        LOG.exception(_("Caught error: %s"), unicode(inner))
-
+        if not isinstance(inner, exception.QuotaError):
+            LOG.exception(_("Caught error: %s"), unicode(inner))
         safe = getattr(inner, 'safe', False)
         headers = getattr(inner, 'headers', None)
         status = getattr(inner, 'code', 500)