1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[storage|aws] fix location stuff to allow creating new buckets properly

This commit is contained in:
geemus 2012-05-28 15:36:54 -05:00
parent ce9b00eacf
commit df6aae8760

View file

@ -36,14 +36,14 @@ module Fog
def location
requires :key
@location || bucket_location || self.connection.region
attributes[:location] || bucket_location || self.connection.region
end
def location=(new_location)
if INVALID_LOCATIONS.include?(new_location)
raise ArgumentError, "location must not include any of #{INVALID_LOCATIONS.join(', ')}. See http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html"
else
@location = new_location
merge_attributes(:location => new_location)
end
end
@ -103,7 +103,9 @@ module Fog
options['x-amz-acl'] = acl if acl
options['LocationConstraint'] = location
if location = attributes[:location] || (self.connection.region != 'us-east-1' && self.connection.region)
options['LocationConstraint'] = location
end
connection.put_bucket(key, options)