mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Nix hardcoded regions: S3 (us-east-1 is special).
This commit is contained in:
parent
c6c621907c
commit
34efabbe48
1 changed files with 2 additions and 28 deletions
|
@ -192,24 +192,10 @@ module Fog
|
||||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||||
options[:region] ||= 'us-east-1'
|
options[:region] ||= 'us-east-1'
|
||||||
@host = options[:host] || case options[:region]
|
@host = options[:host] || case options[:region]
|
||||||
when 'ap-northeast-1'
|
|
||||||
's3-ap-northeast-1.amazonaws.com'
|
|
||||||
when 'ap-southeast-1'
|
|
||||||
's3-ap-southeast-1.amazonaws.com'
|
|
||||||
when 'eu-west-1'
|
|
||||||
's3-eu-west-1.amazonaws.com'
|
|
||||||
when 'us-east-1'
|
when 'us-east-1'
|
||||||
's3.amazonaws.com'
|
's3.amazonaws.com'
|
||||||
when 'sa-east-1'
|
|
||||||
's3-sa-east-1.amazonaws.com'
|
|
||||||
when 'us-west-1'
|
|
||||||
's3-us-west-1.amazonaws.com'
|
|
||||||
when 'us-west-2'
|
|
||||||
's3-us-west-2.amazonaws.com'
|
|
||||||
when 'sa-east-1'
|
|
||||||
's3-sa-east-1.amazonaws.com'
|
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
"s3-#{options[:region]}.amazonaws.com"
|
||||||
end
|
end
|
||||||
@region = options[:region]
|
@region = options[:region]
|
||||||
end
|
end
|
||||||
|
@ -270,22 +256,10 @@ module Fog
|
||||||
else
|
else
|
||||||
options[:region] ||= 'us-east-1'
|
options[:region] ||= 'us-east-1'
|
||||||
@host = options[:host] || case options[:region]
|
@host = options[:host] || case options[:region]
|
||||||
when 'ap-northeast-1'
|
|
||||||
's3-ap-northeast-1.amazonaws.com'
|
|
||||||
when 'ap-southeast-1'
|
|
||||||
's3-ap-southeast-1.amazonaws.com'
|
|
||||||
when 'eu-west-1'
|
|
||||||
's3-eu-west-1.amazonaws.com'
|
|
||||||
when 'us-east-1'
|
when 'us-east-1'
|
||||||
's3.amazonaws.com'
|
's3.amazonaws.com'
|
||||||
when 'sa-east-1'
|
|
||||||
's3-sa-east-1.amazonaws.com'
|
|
||||||
when 'us-west-1'
|
|
||||||
's3-us-west-1.amazonaws.com'
|
|
||||||
when 'us-west-2'
|
|
||||||
's3-us-west-2.amazonaws.com'
|
|
||||||
else
|
else
|
||||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
"s3-#{options[:region]}.amazonaws.com"
|
||||||
end
|
end
|
||||||
@path = options[:path] || '/'
|
@path = options[:path] || '/'
|
||||||
@persistent = options[:persistent] || true
|
@persistent = options[:persistent] || true
|
||||||
|
|
Loading…
Add table
Reference in a new issue