From 36c4a0462ced7a69cb1a287038e778a723bf69e9 Mon Sep 17 00:00:00 2001 From: Ying Liu Date: Tue, 23 Aug 2011 15:15:16 -0700 Subject: [PATCH] remove unnecessary code and sync faults and exception handling --- extensions/_faults.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 -- 2.45.2