From 28071daab8855844e97256dabec640d70a6b979b Mon Sep 17 00:00:00 2001 From: Noboru Iwamatsu Date: Wed, 12 Feb 2020 02:57:09 +0900 Subject: [PATCH] s3_bucket: fix condition checking of requester_pays param. (#64010) --- lib/ansible/modules/cloud/amazon/s3_bucket.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/s3_bucket.py b/lib/ansible/modules/cloud/amazon/s3_bucket.py index 056ebfb3bc4..b932e40fcfc 100644 --- a/lib/ansible/modules/cloud/amazon/s3_bucket.py +++ b/lib/ansible/modules/cloud/amazon/s3_bucket.py @@ -104,8 +104,8 @@ extends_documentation_fragment: notes: - If C(requestPayment), C(policy), C(tagging) or C(versioning) operations/API aren't implemented by the endpoint, module doesn't fail - if related parameters I(requester_pays), I(policy), I(tags) or - I(versioning) are C(None). + if each parameter satisfies the following condition. + I(requester_pays) is C(False), I(policy), I(tags), and I(versioning) are C(None). ''' EXAMPLES = ''' @@ -247,7 +247,7 @@ def create_or_update_bucket(s3_client, module, location): except BotoCoreError as exp: module.fail_json_aws(exp, msg="Failed to get bucket request payment") except ClientError as exp: - if exp.response['Error']['Code'] != 'NotImplemented' or requester_pays is not None: + if exp.response['Error']['Code'] != 'NotImplemented' or requester_pays: module.fail_json_aws(exp, msg="Failed to get bucket request payment") else: if requester_pays: