On Sept. 30, 2013, 6:06 a.m., Michal Minar wrote:
> cli/lmi/shell/LMIUtil.py, line 317
>
<
http://reviewboard-openlmi.rhcloud.com/r/893/diff/2/?file=4974#file4974li...
>
> Keys should not differ when only case varies:
> return hashlib.md5(path.classname.lower() + path.namespace + str({k.lower(): v
for k, v in path.keybindings.items()})).hexdigest()
Good point, will change that to case insensitive.
On Sept. 30, 2013, 6:06 a.m., Michal Minar wrote:
> cli/lmi/shell/LMIUtil.py, line 340
>
<
http://reviewboard-openlmi.rhcloud.com/r/893/diff/2/?file=4974#file4974li...
>
> IMHO this is always True (since instances contain digest as keys, not class
names).
Not always. I have found an occasion, when a key property of a association class points to
some specific class, but instances of the association class point to some other class,
which I think is wrong.
- Peter
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/893/#review1241
-----------------------------------------------------------
On Sept. 27, 2013, 11:12 a.m., Peter Hatina wrote:
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/893/
-----------------------------------------------------------
(Updated Sept. 27, 2013, 11:12 a.m.)
Review request for OpenLMI Developers.
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
-----
cli/lmi/shell/LMIConsole.py bebcce353c9547a9d7ed1c5f0031319e1876b29a
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