Skip to content

Commit

Permalink
vPoller methods '*.datastore.get' return result as a list like the ot…
Browse files Browse the repository at this point in the history
…her methods
  • Loading branch information
dnaeon committed Sep 13, 2014
1 parent 0c17b18 commit 3beb950
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/vpoller/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def _object_datastore_get(self, obj_type, name):
# Find the object by it's 'name' property
# and get the datastores available/used by it
data = self._get_object_properties(
properties=['name', 'datastore'],
properties=['datastore'],
obj_type=obj_type,
obj_property_name='name',
obj_property_value=name
Expand All @@ -407,14 +407,12 @@ def _object_datastore_get(self, obj_type, name):

# Get the name and datastore properties from the result
props = data['result'][0]
obj_name, obj_datastores = props['name'], props['datastore']
obj_datastores = props['datastore']

# Get a list view of the datastores available/used by
# this object and collect properties
view_ref = self.get_list_view(obj=obj_datastores)
result = {}
result['name'] = obj_name
result['datastore'] = self.collect_properties(
result = self.collect_properties(
view_ref=view_ref,
obj_type=pyVmomi.vim.Datastore,
path_set=['name', 'info.url']
Expand Down

0 comments on commit 3beb950

Please sign in to comment.