mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 15:21:25 -07:00
Minor fixes for oVirt modules (#23452)
* cloud: ovirt: only image disk can be sparsified * cloud: ovirt: add post-copy scheduling policy
This commit is contained in:
parent
2ef6713abb
commit
a5020a40e5
2 changed files with 20 additions and 9 deletions
|
@ -571,12 +571,14 @@ def main():
|
|||
downloaded = download_disk_image(connection, module)
|
||||
ret['changed'] = ret['changed'] or downloaded
|
||||
|
||||
# Disk sparsify:
|
||||
ret = disks_module.action(
|
||||
action='sparsify',
|
||||
action_condition=lambda d: module.params['sparsify'],
|
||||
wait_condition=lambda d: d.status == otypes.DiskStatus.OK,
|
||||
)
|
||||
# Disk sparsify, only if disk is of image type:
|
||||
disk = disks_service.disk_service(module.params['id']).get()
|
||||
if disk.storage_type == otypes.DiskStorageType.IMAGE:
|
||||
ret = disks_module.action(
|
||||
action='sparsify',
|
||||
action_condition=lambda d: module.params['sparsify'],
|
||||
wait_condition=lambda d: d.status == otypes.DiskStatus.OK,
|
||||
)
|
||||
elif state == 'absent':
|
||||
ret = disks_module.remove()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue