Fix duplicate bucket creation with LocationConstraint. Closes #970.

This commit is contained in:
Steve Pulec 2017-06-03 19:29:59 -04:00
commit 113bfcb4ea
2 changed files with 22 additions and 0 deletions

View file

@ -336,6 +336,12 @@ class ResponseObject(_TemplateEnvironmentMixin):
self.backend.set_bucket_website_configuration(bucket_name, body)
return ""
else:
if body:
try:
region_name = xmltodict.parse(body)['CreateBucketConfiguration']['LocationConstraint']
except KeyError:
pass
try:
new_bucket = self.backend.create_bucket(
bucket_name, region_name)