# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1220421366 25200
# Node ID 9339b6be10b1e1eb3a90ae1b62e5c37ebf53c48d
# Parent 90ff66d2baee23319d29727d61fa9cf5d8f64f27
[TEST] Update commom_util.py to reflect computersystem.py changes
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 90ff66d2baee -r 9339b6be10b1 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Aug 29 13:26:12 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Tue Sep 02 22:56:06 2008 -0700
@@ -28,7 +28,6 @@ from XenKvmLib.test_xml import *
from XenKvmLib.test_xml import *
from XenKvmLib.test_doms import *
from XenKvmLib import vsms
-from XenKvmLib import computersystem
from XenKvmLib import enumclass
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib.devices import CIM_Instance
@@ -54,7 +53,11 @@ def get_cs_instance(domain_name, ip, vir
def get_cs_instance(domain_name, ip, virt='Xen'):
cs = None
try:
- cs = computersystem.get_cs_class(virt)(ip, domain_name)
+ keys = {
+ 'Name' : domain_name,
+ 'CreationClassName' : get_typed_class(virt,
'ComputerSystem')
+ }
+ cs = enumclass.getInstance(ip, 'ComputerSystem', keys, virt)
if cs.Name != domain_name:
logger.error("VS %s is not found" % domain_name)
@@ -169,12 +172,16 @@ def try_request_state_change(domain_name
def poll_for_state_change(server, virt, dom, exp_state, timeout=30):
dom_cs = None
- cs = computersystem.get_cs_class(virt)
+
+ keys = {
+ 'Name' : dom,
+ 'CreationClassName' : get_typed_class(virt,
'ComputerSystem')
+ }
+ dom_cs = enumclass.getInstance(server, 'ComputerSystem', keys, virt)
try:
for i in range(1, (timeout + 1)):
sleep(1)
- dom_cs = cs(server, name=dom)
if dom_cs is None or dom_cs.Name != dom:
logger.error("CS instance not returned for %s." % dom)
return FAIL, dom_cs
Show replies by date