s3_bucket: accept NetApp StorageGRID create_bucket response. (#67462)

This commit is contained in:
Noboru Iwamatsu 2020-02-25 05:00:39 +09:00 committed by GitHub
parent c5ec0fcb34
commit d317cc71c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- s3_bucket - Accept XNotImplemented response to support NetApp StorageGRID.

View file

@ -24,9 +24,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: s3_bucket module: s3_bucket
short_description: Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus and FakeS3 short_description: Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID
description: description:
- Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus and FakeS3 - Manage S3 buckets in AWS, DigitalOcean, Ceph, Walrus, FakeS3 and StorageGRID
version_added: "2.0" version_added: "2.0"
requirements: [ boto3 ] requirements: [ boto3 ]
author: "Rob White (@wimnat)" author: "Rob White (@wimnat)"
@ -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: if exp.response['Error']['Code'] not in ('NotImplemented', 'XNotImplemented') 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:
@ -305,7 +305,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 tags") module.fail_json_aws(exp, msg="Failed to get bucket tags")
except ClientError as exp: except ClientError as exp:
if exp.response['Error']['Code'] != 'NotImplemented' or tags is not None: if exp.response['Error']['Code'] not in ('NotImplemented', 'XNotImplemented') or tags is not None:
module.fail_json_aws(exp, msg="Failed to get bucket tags") module.fail_json_aws(exp, msg="Failed to get bucket tags")
else: else:
if tags is not None: if tags is not None: