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 = []
|
||||
|
||||
for temp_vm_object in objects:
|
||||
if len(temp_vm_object.propSet) != 1:
|
||||
continue
|
||||
for temp_vm_object_property in temp_vm_object.propSet:
|
||||
if temp_vm_object_property.val == self.params['name']:
|
||||
vms.append(temp_vm_object.obj)
|
||||
break
|
||||
if (
|
||||
len(temp_vm_object.propSet) == 1 and
|
||||
temp_vm_object.propSet[0].val == self.params['name']):
|
||||
vms.append(temp_vm_object.obj)
|
||||
|
||||
# get_managed_objects_properties may return multiple virtual machine,
|
||||
# following code tries to find user desired one depending upon the folder specified.
|
||||
|
|
Loading…
Reference in a new issue