WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Trap bad return values from Xen-API metho

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Trap bad return values from Xen-API method handlers, and return an internal
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 05:30:15 -0700
Delivery-date: Thu, 15 Mar 2007 05:30:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173913979 0
# Node ID acdfb333af532b4eed41a6b4fd72800531cca497
# Parent  e4e1435e4c6399ffe9cbfab3338f6d2e31a4c191
Trap bad return values from Xen-API method handlers, and return an internal
error.

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

diff -r e4e1435e4c63 -r acdfb333af53 tools/python/xen/util/xmlrpclib2.py
--- a/tools/python/xen/util/xmlrpclib2.py       Wed Mar 14 21:59:11 2007 +0000
+++ b/tools/python/xen/util/xmlrpclib2.py       Wed Mar 14 23:12:59 2007 +0000
@@ -199,6 +199,18 @@ class TCPXMLRPCServer(SocketServer.Threa
                 response = dispatch_method(method, params)
             else:
                 response = self._dispatch(method, params)
+
+            if self.xenapi and \
+               (response is None or
+                not isinstance(response, dict) or
+                'Status' not in response):
+                log.exception('Internal error handling %s: Invalid result %s',
+                              method, response)
+                response = { "Status": "Failure",
+                             "ErrorDescription":
+                             ['INTERNAL_ERROR',
+                              'Invalid result %s handling %s' %
+                              (response, method)]}
 
             # With either Unicode or normal strings, we can only transmit
             # \t, \n, \r, \u0020-\ud7ff, \ue000-\ufffd, and \u10000-\u10ffff

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Trap bad return values from Xen-API method handlers, and return an internal, Xen patchbot-unstable <=