buuren / pysphere

Automatically exported from code.google.com/p/pysphere
0 stars 0 forks source link

Some resource pools are missing when calling _get_resource_pools() #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The method returns a dictionary where keys are the resource pool paths and the 
values their MORs.

This path key is formed by the resource pool name and all its ancestors names 
separated by '/'. For example:
/Resources/AnotherRP/This Resource Pool

However there might be more than one root resource pool. The root rp (not shown 
from the VI Client) generally is named "Resources"
So that is not a unique key for the dictionary, in your case you have two rp 
named "/Resources" so adding the second to the dictionary overwrites the first.

I should probably invert the dictionary, i.e. make their MOR (which have to be 
unique) be the keys and the paths, their values).

This will impact on other functionality of pysphere that uses 
_get_resource_pools, so I'll have to check all the code.

Original issue reported on code.google.com by argo...@gmail.com on 20 Jan 2012 at 6:55

GoogleCodeExporter commented 8 years ago
fixed in r52

In order to keep some backwards compatibility, _get_resource_pools was kept but 
it shows a deprecation warning. Now you should use get_resource_pools, which 
returns a similar dictionary but MORs are keys and path names are values so no 
values are lost.

Thanks to centerpoint who detected this bug.

Original comment by argo...@gmail.com on 23 Jan 2012 at 5:35