From 2f3c2691d0d8a0c2456d6d0feaa0267879be7878 Mon Sep 17 00:00:00 2001 From: Julien Simbola Date: Thu, 11 Aug 2022 14:15:42 +0200 Subject: [PATCH] fix ignore_nonexistent_bucket bug for listing (#966) --- plugins/modules/s3_object.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)