Kaitlin Rupert wrote:
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1231268986 28800
# Node ID 270c97141e74456e051361572b2ba77af8f0fd94
# Parent d40521f17a98e3403eef62b0e5c42d8b3b8f5c09
[TEST] Update VSMS 01_definesystem_name.py to use cim_() functions
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r d40521f17a98 -r 270c97141e74
suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py Tue
Jan 06 10:15:08 2009 -0800
+++
b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py Tue
Jan 06 11:09:46 2009 -0800
@@ -23,12 +23,10 @@
#
import sys
-import pywbem
-from VirtLib import utils
-from XenKvmLib.test_doms import undefine_test_domain
-from XenKvmLib.common_util import create_using_definesystem
from XenKvmLib.const import do_main
from CimTest.Globals import logger
+from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.vxml import get_class
SUPPORTED_TYPES = ['Xen', 'KVM', 'XenFV', 'LXC']
default_dom = 'test_domain'
@@ -37,10 +35,18 @@
def main():
options = main.options
- status = create_using_definesystem(default_dom, options.ip,
- virt=options.virt)
- undefine_test_domain(default_dom, options.ip,
- virt=options.virt)
+ cxml = get_class(options.virt)(default_dom)
+
+ ret = cxml.cim_define(options.ip)
+ if not ret:
+ logger.error("Unable to define %s" % default_dom)
+ return FAIL
+
+ status = cxml.cim_start(options.ip)
+ if status != PASS:
+ logger.info("Starting defined %s failed" % default_dom)
Can we change the above log message to something like:
logger.info("Failed to start the defined domain: %s" % default_dom)
or
logger.info("Failed starting defined domain: %s" % default_dom)
or
something much better ?
+
+ cxml.undefine(options.ip)
return status
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com