[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix exception handling when xmlrpclib.Fault is raised, in legacy mode.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174399467 0
# Node ID cb7b69311abb3c7638f36bd2730101c8c7433667
# Parent  e7c6e6621e852b4560305b68e2db4d62ed8e8fc7
Fix exception handling when xmlrpclib.Fault is raised, in legacy mode.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/util/xmlrpclib2.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff -r e7c6e6621e85 -r cb7b69311abb tools/python/xen/util/xmlrpclib2.py
--- a/tools/python/xen/util/xmlrpclib2.py       Tue Mar 20 11:49:04 2007 +0000
+++ b/tools/python/xen/util/xmlrpclib2.py       Tue Mar 20 14:04:27 2007 +0000
@@ -241,10 +241,13 @@ class TCPXMLRPCServer(SocketServer.Threa
                              "ErrorDescription": errdesc },),
                           methodresponse = 1)
                 else:
-                    log.exception('Internal error handling %s', method)
                     import xen.xend.XendClient
-                    response = xmlrpclib.dumps(
-                       xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, 
str(exn)))
+                    if isinstance(exn, xmlrpclib.Fault):
+                        response = xmlrpclib.dumps(exn)
+                    else:
+                        log.exception('Internal error handling %s', method)
+                        response = xmlrpclib.dumps(
+                            
xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn)))
             except:
                 log.exception('Internal error handling error')
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.