s3_bucket: fix condition checking of requester_pays param. (#64010)

This commit is contained in:
Noboru Iwamatsu 2020-02-12 02:57:09 +09:00 committed by GitHub
parent 1867ff4013
commit 28071daab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,8 +104,8 @@ extends_documentation_fragment:
notes: notes:
- If C(requestPayment), C(policy), C(tagging) or C(versioning) - If C(requestPayment), C(policy), C(tagging) or C(versioning)
operations/API aren't implemented by the endpoint, module doesn't fail operations/API aren't implemented by the endpoint, module doesn't fail
if related parameters I(requester_pays), I(policy), I(tags) or if each parameter satisfies the following condition.
I(versioning) are C(None). I(requester_pays) is C(False), I(policy), I(tags), and I(versioning) are C(None).
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -247,7 +247,7 @@ def create_or_update_bucket(s3_client, module, location):
except BotoCoreError as exp: except BotoCoreError as exp:
module.fail_json_aws(exp, msg="Failed to get bucket request payment") module.fail_json_aws(exp, msg="Failed to get bucket request payment")
except ClientError as exp: 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") module.fail_json_aws(exp, msg="Failed to get bucket request payment")
else: else:
if requester_pays: if requester_pays: