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-devel

[Xen-devel] XendAPI.py: syntax error in script in some error cases

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] XendAPI.py: syntax error in script in some error cases
From: "Dube, Lutz" <Lutz.Dube@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Feb 2009 09:57:06 +0100
Accept-language: de-DE, en-US
Acceptlanguage: de-DE, en-US
Delivery-date: Fri, 13 Feb 2009 00:58:18 -0800
Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:Received:From:To:Date: Subject:Thread-Topic:Thread-Index:Message-ID: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:acceptlanguage:Content-Type: MIME-Version; b=UOdwZERl5N0MPcbx7DOCKqmXCw4orH8GFYCeYbx6BALk7cfASKEnK2ux Y5eB92RfQh5TC7Cn3AovN6WAJiXhIOJBlVcPdYP0RlKyvI4aJz4syNCvR g5wSERgF6koQDCj;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmNuQvXW4F0LBQORqqv+Wlv4DbgTw==
Thread-topic: XendAPI.py: syntax error in script in some error cases
# HG changeset patch
# User Lutz.Dube
# Node ID e6ad71ae873c9ad13d4a2d90dbce34612803c555
# Parent  97ca3400d17c5f14af3c36145963d7c6c9a9416e
The patch corrects some syntax errors in xen/xend/XendAPI.py
- usage of undefined variables in error cases (invalid handle specified) in methods
  VBD_create, VTPM_destroy, event_unregister
- not imported module 'uuid' in method debug_create results in an exception
 
Signed-off-by: Lutz Dube <Lutz.Dube@xxxxxxxxxxxxxxxxxxx>
 
Thanks
Lutz Dube
 
diff -r 97ca3400d17c -r e6ad71ae873c tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Feb 04 12:01:47 2009 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Thu Feb 05 16:41:11 2009 +0100
@@ -29,6 +29,7 @@ import XendDomain, XendDomainInfo, XendN
import XendDomain, XendDomainInfo, XendNode, XendDmesg
import XendLogging, XendTaskManager, XendAPIStore
 
+from xen.xend import uuid as genuuid
from XendAPIVersion import *
from XendAuthSessions import instance as auth_manager
from XendError import *
@@ -1867,7 +1868,7 @@ class XendAPI(object):
         dom = xendom.get_vm_by_uuid(vbd_struct['VM'])
         vdi = xennode.get_vdi_by_uuid(vbd_struct['VDI'])
         if not vdi:
-            return xen_api_error(['HANDLE_INVALID', 'VDI', vdi_ref])
+            return xen_api_error(['HANDLE_INVALID', 'VDI', vbd_struct['VDI']])
 
         # new VBD via VDI/SR
         vdi_image = vdi.get_location()
@@ -2392,7 +2393,7 @@ class XendAPI(object):
             tpmif.destroy_vtpmstate(dom.getName())
             return xen_api_success_void()
         else:
-            return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
+            return xen_api_error(['HANDLE_INVALID', 'VTPM', vtpm_ref])
 
     # class methods
     def VTPM_create(self, session, vtpm_struct):
@@ -2614,7 +2615,7 @@ class XendAPI(object):
         return xen_api_success_void()
 
     def event_unregister(self, session, unreg_classes):
-        event_unregister(session, reg_classes)
+        event_unregister(session, unreg_classes)
         return xen_api_success_void()
 
     def event_next(self, session):
@@ -2641,7 +2642,7 @@ class XendAPI(object):
         return xen_api_error(['DEBUG_FAIL', session])
 
     def debug_create(self, session):
-        debug_uuid = uuid.createString()
+        debug_uuid = genuuid.createString()
         self._debug[debug_uuid] = None
         return xen_api_success(debug_uuid)
 
 
---
Lutz Dube
Softwareentwickler
FSC IP SW OS 7
 
Fujitsu Siemens Computers GmbH
Otto-Hahn-Ring 6
81730 München
 
Telefon:                ++49 89 636 49272
Telefax:                ++49 89 636 49974
Email:          mailto:Lutz.Dube@xxxxxxxxxxxxxxxxxxx
 
Internet:               http://www.fujitsu-siemens.de
 
 
 

Attachment: XendAPI_patch
Description: XendAPI_patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] XendAPI.py: syntax error in script in some error cases, Dube, Lutz <=