# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1242814409 25200
# Node ID 68817f9e1c6a078942f616c33aa69e773a23beaf
# Parent 95b9360a2d1c3dce540ea9eeb965bec86ebbdfab
[TEST] Modifying get_pool_rasds() of pool.py.
Modifying get_pool_rasds() of pool.py to return all Parent DiskPool and NetworkPool
records when required.
Tested with KVM on F10 with current sources.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 95b9360a2d1c -r 68817f9e1c6a suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Tue May 19 03:21:20 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Wed May 20 03:13:29 2009 -0700
@@ -106,12 +106,13 @@
return volume
-def get_pool_rasds(server, virt):
+def get_pool_rasds(server, virt,
+ pool_type="NetworkPool", filter_default=True):
net_pool_rasds = []
ac_cn = get_typed_class(virt, "AllocationCapabilities")
an_cn = get_typed_class(virt, "SettingsDefineCapabilities")
- key_list = {"InstanceID" : "NetworkPool/0" }
+ key_list = {"InstanceID" : "%s/0" %pool_type }
try:
inst = GetInstance(server, ac_cn, key_list)
@@ -119,10 +120,13 @@
except Exception, detail:
logger.error("Exception: %s", detail)
return None
-
- for item in rasd:
- if item['InstanceID'] == "Default":
- net_pool_rasds.append(item)
+
+ if filter_default == True:
+ for item in rasd:
+ if item['InstanceID'] == "Default":
+ net_pool_rasds.append(item)
+ else:
+ return rasd
return net_pool_rasds