From: Ying Liu Date: Tue, 23 Aug 2011 22:15:16 +0000 (-0700) Subject: remove unnecessary code and sync faults and exception handling X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=36c4a0462ced7a69cb1a287038e778a723bf69e9;p=openstack-build%2Fneutron-build.git remove unnecessary code and sync faults and exception handling --- diff --git a/extensions/_faults.py b/extensions/_faults.py index 18dd77864..5b9c233ec 100644 --- a/extensions/_faults.py +++ b/extensions/_faults.py @@ -20,7 +20,6 @@ """ import webob.dec -from quantum.api import api_common as common from quantum.common import wsgi @@ -57,14 +56,11 @@ class Fault(webob.exc.HTTPException): fault_data = { fault_name: { 'code': code, - 'message': self.wrapped_exc.explanation, - 'detail': self.wrapped_exc.detail}} + 'message': self.wrapped_exc.explanation}} # 'code' is an attribute on the fault tag itself - metadata = {'application/xml': {'attributes': {fault_name: 'code'}}} - default_xmlns = common.XML_NS_V10 - serializer = wsgi.Serializer(metadata, default_xmlns) content_type = req.best_match_content_type() - #self.wrapped_exc.body = serializer.serialize(fault_data, content_type) + self.wrapped_exc.body = wsgi.Serializer().\ + serialize(fault_data, content_type) self.wrapped_exc.content_type = content_type return self.wrapped_exc