[Libvirt-cim] [PATCH] [TEST] update EnumInstances so it returns both CIMInstance and CIM_CimtestClass objects

yunguol at cn.ibm.com yunguol at cn.ibm.com
Fri Oct 17 06:25:00 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1224224694 25200
# Node ID 3baaf90a47eb13151a67df01718f98b4771df77b
# Parent  69fe94b1348985a337d385865d7522c78f57e116
[TEST] update EnumInstances so it returns both CIMInstance and CIM_CimtestClass objects

Signed-off-by: Guolian Yun <yunguol at cn.ibm.com>

diff -r 69fe94b13489 -r 3baaf90a47eb suites/libvirt-cim/lib/XenKvmLib/enumclass.py
--- a/suites/libvirt-cim/lib/XenKvmLib/enumclass.py	Thu Oct 16 03:14:27 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/enumclass.py	Thu Oct 16 23:24:54 2008 -0700
@@ -477,7 +477,7 @@ def EnumNames(host, cn):
 
     return names
 
-def EnumInstances(host, cn):
+def EnumInstances(host, cn, ret_cim_inst=False):
     '''Resolve the enumeration given the @cn.
     Return a list of CIMInstance objects.'''
 
@@ -491,7 +491,10 @@ def EnumInstances(host, cn):
     list = []
 
     for name in refs:
-        list.append(CIM_CimtestClass(host, name))
+        inst = CIM_CimtestClass(host, name)
+        if ret_cim_inst:
+            inst = inst.inst
+        list.append(inst)
  
     return list
 




More information about the Libvirt-cim mailing list