mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Nix hardcoded regions: EMR.
This commit is contained in:
parent
93bd6d0834
commit
cad849b173
1 changed files with 2 additions and 19 deletions
|
@ -57,7 +57,7 @@ module Fog
|
||||||
#
|
#
|
||||||
# ==== Parameters
|
# ==== Parameters
|
||||||
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
# * 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-southeast-1']
|
# * region<~String> - optional region to use. For instance, in 'eu-west-1', 'us-east-1' and etc.
|
||||||
#
|
#
|
||||||
# ==== Returns
|
# ==== Returns
|
||||||
# * EMR object with connection to AWS.
|
# * EMR object with connection to AWS.
|
||||||
|
@ -68,24 +68,7 @@ module Fog
|
||||||
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
||||||
|
|
||||||
options[:region] ||= 'us-east-1'
|
options[:region] ||= 'us-east-1'
|
||||||
@host = options[:host] || case options[:region]
|
@host = options[:host] || "elasticmapreduce.#{options[:region]}.amazonaws.com"
|
||||||
when 'ap-northeast-1'
|
|
||||||
'elasticmapreduce.ap-northeast-1.amazonaws.com'
|
|
||||||
when 'ap-southeast-1'
|
|
||||||
'elasticmapreduce.ap-southeast-1.amazonaws.com'
|
|
||||||
when 'eu-west-1'
|
|
||||||
'elasticmapreduce.eu-west-1.amazonaws.com'
|
|
||||||
when 'us-east-1'
|
|
||||||
'elasticmapreduce.us-east-1.amazonaws.com'
|
|
||||||
when 'us-west-1'
|
|
||||||
'elasticmapreduce.us-west-1.amazonaws.com'
|
|
||||||
when 'us-west-2'
|
|
||||||
'elasticmapreduce.us-west-2.amazonaws.com'
|
|
||||||
when 'sa-east-1'
|
|
||||||
'elasticmapreduce.sa-east-1.amazonaws.com'
|
|
||||||
else
|
|
||||||
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
|
||||||
end
|
|
||||||
@path = options[:path] || '/'
|
@path = options[:path] || '/'
|
||||||
@persistent = options[:persistent] || false
|
@persistent = options[:persistent] || false
|
||||||
@port = options[:port] || 443
|
@port = options[:port] || 443
|
||||||
|
|
Loading…
Add table
Reference in a new issue