mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
a611449cad
commit
625ee36e06
1 changed files with 10 additions and 8 deletions
|
@ -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():
|
||||
|
|
Loading…
Reference in a new issue