pysphere
pysphere copied to clipboard
Add a __getitem__ method to VIVirtualMachine class
This is an enhancement proposal. It would be fantastic if we could add a
__getitem__ method to VIVirtualMachine classes so that one might be able to
index a VIVirtualMachine instance—like so: vm['memory_mb']—and get the
pertinent information. This would essentially be a shorthand for the following:
``
vm.get_properties()['memory_mb']
``
Original issue reported on code.google.com by [email protected]
on 30 Aug 2013 at 3:53
Note that there's an optional parameter in properties from_cache which makes it
impossible to be *replaced* by something like this. Imo it's not a good thing
to have two obvious ways to get exactly the same information.
Original comment by [email protected]
on 4 Dec 2013 at 2:22