diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 30e7da8d394..b14d38d7aad 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,7 @@ Bugfixes - elb_application_lb - fix ``KeyError`` when balancing across two Target Groups (https://github.com/ansible-collections/community.aws/issues/1089). - elb_classic_lb - fix ``'NoneType' object has no attribute`` bug when creating a new ELB in check mode with a health check (https://github.com/ansible-collections/amazon.aws/pull/915). - elb_classic_lb - fix ``'NoneType' object has no attribute`` bug when creating a new ELB using security group names (https://github.com/ansible-collections/amazon.aws/issues/914). +- s3_object - fix ignore_nonexistent_bucket is not used when listing a bucket (https://github.com/ansible-collections/amazon.aws/issues/966). v4.0.0 ====== diff --git a/plugins/modules/s3_object.py b/plugins/modules/s3_object.py index dcefbcae674..7f979719eef 100644 --- a/plugins/modules/s3_object.py +++ b/plugins/modules/s3_object.py @@ -1168,10 +1168,9 @@ def main(): # Support for listing a set of keys if mode == 'list': - exists = bucket_check(module, s3, bucket) # If the bucket does not exist then bail out - if not exists: + if not bucketrtn: module.fail_json(msg="Target bucket (%s) cannot be found" % bucket) list_keys(module, s3, bucket, prefix, marker, max_keys)