VMware: Simplifying get_vm() in module_utils.vmware (#62217)
This commit is contained in:
parent
46a6c28bb0
commit
e0373a73a8
1 changed files with 4 additions and 6 deletions
|
@ -970,12 +970,10 @@ class PyVmomi(object):
|
||||||
vms = []
|
vms = []
|
||||||
|
|
||||||
for temp_vm_object in objects:
|
for temp_vm_object in objects:
|
||||||
if len(temp_vm_object.propSet) != 1:
|
if (
|
||||||
continue
|
len(temp_vm_object.propSet) == 1 and
|
||||||
for temp_vm_object_property in temp_vm_object.propSet:
|
temp_vm_object.propSet[0].val == self.params['name']):
|
||||||
if temp_vm_object_property.val == self.params['name']:
|
|
||||||
vms.append(temp_vm_object.obj)
|
vms.append(temp_vm_object.obj)
|
||||||
break
|
|
||||||
|
|
||||||
# get_managed_objects_properties may return multiple virtual machine,
|
# get_managed_objects_properties may return multiple virtual machine,
|
||||||
# following code tries to find user desired one depending upon the folder specified.
|
# following code tries to find user desired one depending upon the folder specified.
|
||||||
|
|
Loading…
Reference in a new issue