diff --git a/lib/fog/aws/models/storage/directory.rb b/lib/fog/aws/models/storage/directory.rb index 3ac4bdf2f8..f6d58e1235 100644 --- a/lib/fog/aws/models/storage/directory.rb +++ b/lib/fog/aws/models/storage/directory.rb @@ -31,7 +31,7 @@ def destroy end def location - @location ||= (bucket_location || self.service.region) + @location ||= (bucket_location || AWS::DEFAULT_REGION) end # NOTE: you can't change the region once the bucket is created diff --git a/tests/models/storage/directory_tests.rb b/tests/models/storage/directory_tests.rb index a26c4389d5..211b9e1636 100644 --- a/tests/models/storage/directory_tests.rb +++ b/tests/models/storage/directory_tests.rb @@ -9,6 +9,10 @@ @instance.public_url end + tests('#location').returns('us-east-1') do # == Fog::AWS::Storage::DEFAULT_REGION + @instance.location + end + @instance.acl = 'public-read' @instance.save