Skip to content

Commit a8518f0

Browse files
authored
Drop warning if region is not us-east-1 in mock (#717)
Previously if `Fog.mock!` were used with some other region and the bucket already existed, a warning message, `Your region <region> does not match the default region 'us-east-1'". We were seeing a lot of these warnings in our test suite. As far as I can tell, there's no reason why some other region can't be used, so drop this.
1 parent 0c66a51 commit a8518f0

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

lib/fog/aws/requests/storage/put_bucket.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ def put_bucket(bucket_name, options = {})
6161
end
6262
if !self.data[:buckets][bucket_name]
6363
self.data[:buckets][bucket_name] = bucket
64-
elsif self.region != 'us-east-1'
65-
response.status = 409
66-
Fog::Logger.warning "Your region '#{self.region}' does not match the default region 'us-east-1'"
67-
raise(Excon::Errors.status_error({:expects => 201}, response))
6864
end
6965
response
7066
end

tests/requests/storage/bucket_tests.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,6 @@
395395
Fog::Storage[:aws].put_bucket_website('fognonbucket', 'index.html')
396396
end
397397

398-
tests('put existing bucket - non-default region') do
399-
storage_eu_endpoint = Fog::Storage[:aws]
400-
storage_eu_endpoint.region = "eu-west-1"
401-
storage_eu_endpoint.put_bucket(@aws_bucket_name)
402-
403-
tests("#put_bucket('#{@aws_bucket_name}') existing").raises(Excon::Errors::Conflict) do
404-
storage_eu_endpoint.put_bucket(@aws_bucket_name)
405-
end
406-
end
407-
408398
tests("#put_bucket_website('fognonbucket', :RedirectAllRequestsTo => 'redirect.example.com')").raises(Excon::Errors::NotFound) do
409399
Fog::Storage[:aws].put_bucket_website('fognonbucket', :RedirectAllRequestsTo => 'redirect.example.com')
410400
end

0 commit comments

Comments
 (0)