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] Adjust the argument counts for a MESSAGE_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Adjust the argument counts for a MESSAGE_PARAMETER_COUNT_MISMATCH to account for
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Dec 2006 10:55:06 -0800
Delivery-date: Mon, 25 Dec 2006 10:55:47 -0800
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 1167057161 0
# Node ID 4e079a8496b7521f60562d09ca285c0dd436c37d
# Parent  367f0c6efe2178e26ba0194ca795ff098e22a80b
Adjust the argument counts for a MESSAGE_PARAMETER_COUNT_MISMATCH to account for
the fact that XenAPI adds the session handle transparently.

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

diff -r 367f0c6efe21 -r 4e079a8496b7 tools/python/xen/xm/XenAPI.py
--- a/tools/python/xen/xm/XenAPI.py     Sat Dec 23 21:32:05 2006 +0000
+++ b/tools/python/xen/xm/XenAPI.py     Mon Dec 25 14:32:41 2006 +0000
@@ -54,7 +54,17 @@ gettext.install('xen-xm')
 
 class Failure(Exception):
     def __init__(self, details):
-        self.details = details
+        try:
+            # If this failure is MESSAGE_PARAMETER_COUNT_MISMATCH, then we
+            # correct the return values here, to account for the fact that we
+            # transparently add the session handle as the first argument.
+            if details[0] == 'MESSAGE_PARAMETER_COUNT_MISMATCH':
+                details[2] = str(int(details[2]) - 1)
+                details[3] = str(int(details[3]) - 1)
+
+            self.details = details
+        except Exception, exn:
+            self.details = ['INTERNAL_ERROR', 'Client-side: ' + str(exn)]
 
     def __str__(self):
         try:

_______________________________________________
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] Adjust the argument counts for a MESSAGE_PARAMETER_COUNT_MISMATCH to account for, Xen patchbot-unstable <=