mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
Fix idempotence for deleting ElasticBeanstalk applications (#35614)
This commit is contained in:
parent
b9571eb4bf
commit
ee209e5f6f
1 changed files with 8 additions and 2 deletions
|
@ -209,10 +209,16 @@ def main():
|
||||||
ebs.delete_application(ApplicationName=app_name, TerminateEnvByForce=terminate_by_force)
|
ebs.delete_application(ApplicationName=app_name, TerminateEnvByForce=terminate_by_force)
|
||||||
else:
|
else:
|
||||||
ebs.delete_application(ApplicationName=app_name)
|
ebs.delete_application(ApplicationName=app_name)
|
||||||
except (BotoCoreError, ClientError) as e:
|
changed = True
|
||||||
|
except BotoCoreError as e:
|
||||||
module.fail_json_aws(e, msg="Cannot terminate app")
|
module.fail_json_aws(e, msg="Cannot terminate app")
|
||||||
|
except ClientError as e:
|
||||||
|
if 'It is currently pending deletion.' not in e.response['Error']['Message']:
|
||||||
|
module.fail_json_aws(e, msg="Cannot terminate app")
|
||||||
|
else:
|
||||||
|
changed = False
|
||||||
|
|
||||||
result = dict(changed=True, app=app)
|
result = dict(changed=changed, app=app)
|
||||||
|
|
||||||
module.exit_json(**result)
|
module.exit_json(**result)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue