mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Make os_volume idempotent (#24881)
Fix adds idempotency while deleting volume in os_volume module Fixes #19619 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
committed by
Ricardo Carrillo Cruz
parent
a611449cad
commit
625ee36e06
@@ -131,14 +131,16 @@ def _present_volume(module, cloud):
|
||||
|
||||
|
||||
def _absent_volume(module, cloud):
|
||||
try:
|
||||
cloud.delete_volume(
|
||||
name_or_id=module.params['display_name'],
|
||||
wait=module.params['wait'],
|
||||
timeout=module.params['timeout'])
|
||||
except shade.OpenStackCloudTimeout:
|
||||
module.exit_json(changed=False)
|
||||
module.exit_json(changed=True)
|
||||
changed = False
|
||||
if cloud.volume_exists(module.params['display_name']):
|
||||
try:
|
||||
changed = cloud.delete_volume(name_or_id=module.params['display_name'],
|
||||
wait=module.params['wait'],
|
||||
timeout=module.params['timeout'])
|
||||
except shade.OpenStackCloudTimeout:
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user