----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/461/#review558 -----------------------------------------------------------
Ship it!
Ship It!
- Stephen Gallagher
On June 18, 2013, 1:10 p.m., Peter Hatina wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/461/
(Updated June 18, 2013, 1:10 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-tools
Description
Honza S.:
In a lmishell script I want to manually loop over all properties and get their values. I can use _LmiInstance.properties() to get list of properties, but there is no way, how to get property values. Either _LmiInstance.properties() should return a dictionary or there should be _LmiInstance.get_property(name) method.
Sample code:
i = c.root.cimv2.LMI_StorageExtent.first_instance() for p in i.properties: print p, i.get_property(p)
There is a way, how to get properties:
i = c.root.cimv2.LMI_StorageExtent.first_instance() for p in i.properties: print p, getattr(i, p) ^^
Or how to get Names property value: i.Names
Dunno, if it is a correct (python) way. Maybe it should be switched to a "dictionary style". I used this attitude just because of methods access.
Diffs
cli-tools/lmi/lmi_client_shell.py 54bd8b263002c5df9f3d7dad414e75cae9bc3c41
Diff: http://reviewboard-openlmi.rhcloud.com/r/461/diff/
Testing
Thanks,
Peter Hatina