Skip to content

Commit

Permalink
The 'datastore.vm.get' method returns a list as the result as all other
Browse files Browse the repository at this point in the history
methods do
  • Loading branch information
dnaeon committed Sep 13, 2014
1 parent 2418902 commit ab1d68b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/vpoller/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ def datastore_vm_get(self, msg):
# Find the Datastore by it's 'info.url' property and get the
# VirtualMachine objects using it
data = self._get_object_properties(
properties=['info.name', 'info.url', 'vm'],
properties=['vm'],
obj_type=pyVmomi.vim.Datastore,
obj_property_name='info.url',
obj_property_value=msg['name']
Expand All @@ -2004,15 +2004,12 @@ def datastore_vm_get(self, msg):

# Get properties from the result
props = data['result'][0]
obj_name, obj_url, obj_host = props['info.name'], props['info.url'], props['vm']
obj_vm = props['vm']

# Get a list view of the VMs from this datastore object
# and collect their properties
view_ref = self.get_list_view(obj=obj_host)
result = {}
result['name'] = obj_name
result['url'] = obj_url
result['vm'] = self.collect_properties(
view_ref = self.get_list_view(obj=obj_vm)
result = self.collect_properties(
view_ref=view_ref,
obj_type=pyVmomi.vim.VirtualMachine,
path_set=['name']
Expand Down

0 comments on commit ab1d68b

Please sign in to comment.