# 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