mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-25 16:06:43 +00:00
ovirt_disk: Fix vm creation (#55910)
This commit is contained in:
@@ -701,10 +701,10 @@ def main():
|
||||
disk = _search_by_lun(disks_service, lun.get('id'))
|
||||
else:
|
||||
disk = disks_module.search_entity(search_params=searchable_attributes(module))
|
||||
if vm_service:
|
||||
if vm_service and disk:
|
||||
# If the VM don't exist in VMs disks, but still it's found it means it was found
|
||||
# for template with same name as VM, so we should force create the VM disk.
|
||||
force_create = disk.id not in [a.disk.id for a in vm_service.disk_attachments_service().list()]
|
||||
force_create = disk.id not in [a.disk.id for a in vm_service.disk_attachments_service().list() if a.disk]
|
||||
|
||||
ret = None
|
||||
# First take care of creating the VM, if needed:
|
||||
|
||||
Reference in New Issue
Block a user