aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:38:16 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-02-13 09:38:16 +0000
commit737073ac89f753d7601933a29bf71365f733744b (patch)
tree5872f7a0c6264245ffde1f0d03143bf4dce6f17f /tools
parente668284679c40615091b3e257fe78352e538efc4 (diff)
downloadxen-737073ac89f753d7601933a29bf71365f733744b.tar.gz
xen-737073ac89f753d7601933a29bf71365f733744b.tar.bz2
xen-737073ac89f753d7601933a29bf71365f733744b.zip
xenapi: Correct 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@fujitsu-siemens.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendAPI.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py
index 71aac01f90..b4a33c4be1 100644
--- a/tools/python/xen/xend/XendAPI.py
+++ b/tools/python/xen/xend/XendAPI.py
@@ -29,6 +29,7 @@ import xmlrpclib
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)