mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Nix hardcoded regions: EC2.
This commit is contained in:
parent
aef757d4b0
commit
2a7c04e519
1 changed files with 3 additions and 20 deletions
|
@ -248,8 +248,8 @@ module Fog
|
|||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
||||
# * region<~String> - optional region to use, in
|
||||
# ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-northeast-1', 'ap-southeast-1']
|
||||
# * region<~String> - optional region to use. For instance,
|
||||
# 'eu-west-1', 'us-east-1', and etc.
|
||||
# * aws_session_token<~String> - when using Session Tokens or Federated Users, a session_token must be presented
|
||||
#
|
||||
# ==== Returns
|
||||
|
@ -271,24 +271,7 @@ module Fog
|
|||
@port = endpoint.port
|
||||
@scheme = endpoint.scheme
|
||||
else
|
||||
@host = options[:host] || case options[:region]
|
||||
when 'ap-northeast-1'
|
||||
'ec2.ap-northeast-1.amazonaws.com'
|
||||
when 'ap-southeast-1'
|
||||
'ec2.ap-southeast-1.amazonaws.com'
|
||||
when 'eu-west-1'
|
||||
'ec2.eu-west-1.amazonaws.com'
|
||||
when 'us-east-1'
|
||||
'ec2.us-east-1.amazonaws.com'
|
||||
when 'us-west-1'
|
||||
'ec2.us-west-1.amazonaws.com'
|
||||
when 'us-west-2'
|
||||
'ec2.us-west-2.amazonaws.com'
|
||||
when 'sa-east-1'
|
||||
'ec2.sa-east-1.amazonaws.com'
|
||||
else
|
||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
||||
end
|
||||
@host = options[:host] || "ec2.#{options[:region]}.amazonaws.com"
|
||||
@path = options[:path] || '/'
|
||||
@persistent = options[:persistent] || false
|
||||
@port = options[:port] || 443
|
||||
|
|
Loading…
Reference in a new issue