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] Fix the handling of MESSAGE_METHOD_UNKNOW

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix the handling of MESSAGE_METHOD_UNKNOWN, MESSAGE_PARAMETER_COUNT_MISMATCH,
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jan 2007 06:00:52 -0800
Delivery-date: Tue, 30 Jan 2007 06:03:19 -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 1170009462 0
# Node ID a7fc9cc9a51f01f7d0b7df046944735182b011b3
# Parent  58344c358aa0a1c89da5e592ae36f9067f63602d
Fix the handling of MESSAGE_METHOD_UNKNOWN, MESSAGE_PARAMETER_COUNT_MISMATCH,
through the AsyncProxy.

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

diff -r 58344c358aa0 -r a7fc9cc9a51f tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Sun Jan 28 18:05:13 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Sun Jan 28 18:37:42 2007 +0000
@@ -2019,18 +2019,21 @@ class XendAPIAsyncProxy:
 
         # Only deal with method names that start with "Async."
         if not method.startswith(self.method_prefix):
-            raise Exception('Method %s not supported' % method)
-
-        # Require 'session' argument to be present.
-        if len(args) < 1:
-            raise Exception('Not enough arguments')
+            return xen_api_error(['MESSAGE_METHOD_UNKNOWN', method])
 
         # Lookup synchronous version of the method
         synchronous_method_name = method[len(self.method_prefix):]
         if synchronous_method_name not in self.method_map:
-            raise Exception('Method %s not supported' % method)
+            return xen_api_error(['MESSAGE_METHOD_UNKNOWN', method])
         
         method = self.method_map[synchronous_method_name]
+
+        # Check that we've got enough arguments before issuing a task ID.
+        needed = argcounts[method.api]
+        if len(args) != needed:
+            return xen_api_error(['MESSAGE_PARAMETER_COUNT_MISMATCH',
+                                  self.method_prefix + method.api, needed,
+                                  len(args)])
 
         # Validate the session before proceeding
         session = args[0]

_______________________________________________
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] Fix the handling of MESSAGE_METHOD_UNKNOWN, MESSAGE_PARAMETER_COUNT_MISMATCH,, Xen patchbot-unstable <=