make VTPM.destroy return void upon success
PATCH 1/1 make VTPM.destroy return void upon success
Make the VTPM.destroy method return 'void' upon success and adapt the test case to reflect that.
Signed-off-by Stefan Berger <[email protected]>
tools/python/xen/xend/XendAPI.py +1 -1
@@ -1900,7 +1900,7 @@ class XendAPI(object): XendDomain.POWER_STATE_NAMES[dom.state]]) from xen.xend.server import tpmif tpmif.destroy_vtpmstate(dom.getName()) - return xen_api_success(True) + return xen_api_success_void() else: return xen_api_error(['HANDLE_INVALID', 'VM', vtpm_struct['VM']])
tools/xm-test/tests/vtpm/09_vtpm-xapi.py +5 -4
@@ -113,7 +113,7 @@ if not re.search("PCR-00:",run["output"] FAIL("1. Virtual TPM is not working correctly on /dev/vtpm on backend side: \n%s" % run["output"]) try: - rc = session.xenapi.VTPM.destroy(vtpm_uuid) + session.xenapi.VTPM.destroy(vtpm_uuid) #Should never get here FAIL("Could destroy vTPM while VM is running") except:
@@ -124,7 +124,7 @@ if rc: FAIL("Could not suspend VM") try: - rc = session.xenapi.VTPM.destroy(vtpm_uuid) + session.xenapi.VTPM.destroy(vtpm_uuid) #May not throw an exception in 'suspend' state except: pass
@@ -150,8 +150,9 @@ if not re.search("PCR-00:",run["output"] domain.stop() -rc = session.xenapi.VTPM.destroy(vtpm_uuid) -if not rc: +try: + session.xenapi.VTPM.destroy(vtpm_uuid) +except: FAIL("Could NOT destroy vTPM while domain is halted.") domain.destroy()
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 4 lines · Stefan Berger
Make the VTPM.destroy method return 'void' upon success and adapt the test case to reflect that.
Signed-off-by Stefan Berger <[email protected]>
Applied.
Ewan.