mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix error when removing S3 lifecycle rules (#42762)
This commit is contained in:
parent
a7d0804279
commit
67cf2da2a1
1 changed files with 3 additions and 2 deletions
|
@ -415,8 +415,9 @@ def destroy_lifecycle_rule(client, module):
|
|||
try:
|
||||
if lifecycle_obj['Rules']:
|
||||
client.put_bucket_lifecycle_configuration(Bucket=name, LifecycleConfiguration=lifecycle_obj)
|
||||
else:
|
||||
client.delete_lifecycle_configuration(Bucket=name)
|
||||
elif current_lifecycle_rules:
|
||||
changed = True
|
||||
client.delete_bucket_lifecycle(Bucket=name)
|
||||
except (ClientError, BotoCoreError) as e:
|
||||
module.fail_json_aws(e)
|
||||
module.exit_json(changed=changed)
|
||||
|
|
Loading…
Reference in a new issue