# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1252412311 25200
# Node ID 4c9b50a928295e90904b2f560334cd2c398808af
# Parent 465cfe3802c691e2315dc47eb07790df6c96fb77
[TEST] Adding get_diskpool() to pool.py
Added get_diskpool() definition to pool.py as this will be referenced by
RPCS/10*py, RPCS/11*py and RPCS/12*py.
Tested with KVM and current sources on SLES11.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 465cfe3802c6 -r 4c9b50a92829 suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue Sep 08 00:20:01 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue Sep 08 05:18:31 2009 -0700
@@ -25,7 +25,7 @@
from CimTest.ReturnCodes import PASS, FAIL, SKIP
from XenKvmLib.classes import get_typed_class, inst_to_mof
from XenKvmLib.const import get_provider_version, default_pool_name
-from XenKvmLib.enumclass import EnumInstances, GetInstance
+from XenKvmLib.enumclass import EnumInstances, GetInstance, EnumNames
from XenKvmLib.assoc import Associators
from VirtLib.utils import run_remote
from XenKvmLib.xm_virt_util import virt2uri, net_list
@@ -40,6 +40,7 @@
cim_mname = "CreateChildResourcePool"
input_graphics_pool_rev = 757
libvirt_cim_child_pool_rev = 837
+libvirt_rasd_spool_del_changes = 971
DIR_POOL = 1L
FS_POOL = 2L
@@ -339,3 +340,16 @@
return None
return dpool_rasd
+
+def get_diskpool(server, virt, dp_cn, pool_name):
+ dp_inst = None
+ dpool_cn = get_typed_class(virt, dp_cn)
+ pools = EnumNames(server, dpool_cn)
+
+ dp_inst_id = "%s/%s" % (dp_cn, pool_name)
+ for pool in pools:
+ if pool['InstanceID'] == dp_inst_id:
+ dp_inst = pool
+ break
+
+ return dp_inst