mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07: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):
|
def _absent_volume(module, cloud):
|
||||||
try:
|
changed = False
|
||||||
cloud.delete_volume(
|
if cloud.volume_exists(module.params['display_name']):
|
||||||
name_or_id=module.params['display_name'],
|
try:
|
||||||
wait=module.params['wait'],
|
changed = cloud.delete_volume(name_or_id=module.params['display_name'],
|
||||||
timeout=module.params['timeout'])
|
wait=module.params['wait'],
|
||||||
except shade.OpenStackCloudTimeout:
|
timeout=module.params['timeout'])
|
||||||
module.exit_json(changed=False)
|
except shade.OpenStackCloudTimeout:
|
||||||
module.exit_json(changed=True)
|
module.exit_json(changed=changed)
|
||||||
|
|
||||||
|
module.exit_json(changed=changed)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue