]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
remove unnecessary code and sync faults and exception handling
authorYing Liu <yinliu2@cisco.com>
Tue, 23 Aug 2011 22:15:16 +0000 (15:15 -0700)
committerYing Liu <yinliu2@cisco.com>
Tue, 23 Aug 2011 22:15:16 +0000 (15:15 -0700)
extensions/_faults.py

index 18dd77864e58dd223723a449c21704bfae7c027a..5b9c233ec4e9e42b6565c2a1dbdd68dd4be1c87d 100644 (file)
@@ -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