# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1222776362 25200
# Node ID 52f8b84c5bc6c3665b434b18707e2debbc0c0bff
# Parent 0ecb3a22c3617eaa4298dfd9cd3b7b27b9846110
[TEST] Fixing assoc.py and updating the Associators and AssociatorNames to work with
sblim-base-providers.
Tested with Xen, XenFV, KVM on current sources and with/without sblim-base-provider
installed.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 0ecb3a22c361 -r 52f8b84c5bc6 suites/libvirt-cim/lib/XenKvmLib/assoc.py
--- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py Fri Sep 26 02:44:52 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py Tue Sep 30 05:06:02 2008 -0700
@@ -42,13 +42,16 @@ def AssociatorNames(host, basetype, base
type = basetype.split('_')
if len(type) == 2:
basetype = type[1]
-
- obj = baseobj.split('_')
- if len(type) == 2:
- baseobj = obj[1]
+
+ if baseobj != 'Linux_ComputerSystem':
+ obj = baseobj.split('_')
+ if len(obj) == 2:
+ baseobj = obj[1]
+ obj = get_typed_class(virt, baseobj)
+ else:
+ obj = baseobj
type = get_typed_class(virt, basetype)
- obj = get_typed_class(virt, baseobj)
conn = myWBEMConnection('http://%s' % host,
(Globals.CIM_USER, Globals.CIM_PASS),
Globals.CIM_NS)
@@ -77,12 +80,16 @@ def Associators(host, basetype, baseobj,
if len(type) == 2:
basetype = type[1]
- obj = baseobj.split('_')
- if len(obj) == 2:
- baseobj = obj[1]
+ if baseobj != 'Linux_ComputerSystem':
+ obj = baseobj.split('_')
+ if len(obj) == 2:
+ baseobj = obj[1]
+ obj = get_typed_class(virt, baseobj)
+ else:
+ obj = baseobj
+
type = get_typed_class(virt, basetype)
- obj = get_typed_class(virt, baseobj)
conn = myWBEMConnection('http://%s' % host,
(Globals.CIM_USER, Globals.CIM_PASS),
Globals.CIM_NS)