-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/893/
-----------------------------------------------------------
(Updated Sept. 30, 2013, 7:36 a.m.)
Review request for OpenLMI Developers.
Changes
-------
Updated diff.
Repository: openlmi-tools
Description
-------
This patch introduces lmi_associators() function, which should speed up associations
traversal by pulling all the instances referenced by association class.
Diffs (updated)
-----
cli/lmi/shell/LMIUtil.py 94f38b4ffedc286e3ac407085b66ad278ed1bcda
Diff:
http://reviewboard-openlmi.rhcloud.com/r/893/diff/
Testing
-------
Example of usage:
c = connect(...)
assoc_class_list = [
c.root.cimv2.CIM_BasedOn,
c.root.cimv2.LMI_PhysicalMemoryContainer,
c.root.cimv2.LMI_SystemStorageDevice,
]
for tpl in lmi_associators(assoc_class_list):
print " <-> ".join([get_instance_id(x) for x in tpl])
Output:
/dev/disk/by-uuid/fc6b795d-8722-4222-9252-3cfb3b704dd3 <-> /dev/vda
/dev/disk/by-uuid/09331a46-7876-46de-b9f9-496fc3ff5870 <-> /dev/vda
/dev/disk/by-id/dm-name-volgroup1-lvol0 <->
/dev/disk/by-id/ata-QEMU_HARDDISK_QM00005
/dev/disk/by-id/dm-name-volgroup1-lvol0 <->
/dev/disk/by-id/ata-QEMU_HARDDISK_QM00007
LMI:LMI_MemoryPhysicalPackage:0 <-> LMI:LMI_PhysicalMemory:0
rawhide <-> /dev/disk/by-id/ata-QEMU_HARDDISK_QM00005
rawhide <-> /dev/disk/by-id/ata-QEMU_HARDDISK_QM00007
rawhide <-> /dev/vda
rawhide <-> /dev/disk/by-uuid/fc6b795d-8722-4222-9252-3cfb3b704dd3
rawhide <-> /dev/disk/by-uuid/09331a46-7876-46de-b9f9-496fc3ff5870
rawhide <-> /dev/disk/by-id/dm-name-volgroup1-lvol0
NOTE: Function get_instance_id() is local helper function, which returns key property of a
class.
Thanks,
Peter Hatina