mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Correct usage of FindByUuid in vmware module util (#26040)
This fix corrects the usage of function FindByUuid by specifying correct parameter 'uuid' and 'instanceUuid' as documentation of VMWare's API. Fixes: #24398, #24835, #25713 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
c6d012a2eb
commit
f5e9d19af7
2 changed files with 10 additions and 4 deletions
|
@ -182,7 +182,8 @@ def find_vm_by_id(content, vm_id, vm_id_type="vm_name", datacenter=None, cluster
|
|||
if isinstance(vm, vim.VirtualMachine):
|
||||
vm = None
|
||||
elif vm_id_type == 'uuid':
|
||||
vm = si.FindByUuid(datacenter=datacenter, instanceUuid=vm_id, vmSearch=True)
|
||||
# Search By BIOS UUID rather than instance UUID
|
||||
vm = si.FindByUuid(datacenter=datacenter, instanceUuid=False, uuid=vm_id, vmSearch=True)
|
||||
elif vm_id_type == 'ip':
|
||||
vm = si.FindByIp(datacenter=datacenter, ip=vm_id, vmSearch=True)
|
||||
elif vm_id_type == 'vm_name':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue