feat(#1959): LocationConstraint us-east-1 is not accepted by the CreateBucket operation
This commit is contained in:
parent
9291ff533a
commit
437eb892e2
@ -432,8 +432,19 @@ class ResponseObject(_TemplateEnvironmentMixin):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
if body:
|
if body:
|
||||||
|
# us-east-1, the default AWS region behaves a bit differently
|
||||||
|
# - you should not use it as a location constraint --> it fails
|
||||||
|
# - querying the location constraint returns None
|
||||||
try:
|
try:
|
||||||
region_name = xmltodict.parse(body)['CreateBucketConfiguration']['LocationConstraint']
|
forced_region = xmltodict.parse(body)['CreateBucketConfiguration']['LocationConstraint']
|
||||||
|
|
||||||
|
if forced_region == DEFAULT_REGION_NAME:
|
||||||
|
raise S3ClientError(
|
||||||
|
'InvalidLocationConstraint',
|
||||||
|
'The specified location-constraint is not valid'
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
region_name = forced_region
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user