From 90b5b5e3bf45b398f577b8abe8d346a28991667c Mon Sep 17 00:00:00 2001 From: James Muscat Date: Thu, 31 Dec 2015 15:29:07 +0000 Subject: [PATCH] When not specified, region for a bucket should be DEFAULT_REGION. --- lib/fog/aws/models/storage/directory.rb | 2 +- tests/models/storage/directory_tests.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fog/aws/models/storage/directory.rb b/lib/fog/aws/models/storage/directory.rb index 3ac4bdf2f..f6d58e123 100644 --- a/lib/fog/aws/models/storage/directory.rb +++ b/lib/fog/aws/models/storage/directory.rb @@ -31,7 +31,7 @@ module Fog 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 a26c4389d..211b9e163 100644 --- a/tests/models/storage/directory_tests.rb +++ b/tests/models/storage/directory_tests.rb @@ -9,6 +9,10 @@ Shindo.tests("Storage[:aws] | directory", ["aws"]) do @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