1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Nix hardcoded regions: SQS (us-east-1 is special).

This commit is contained in:
Pavel Repin 2012-02-02 15:32:36 -08:00
parent 968b757949
commit c6c621907c

View file

@ -71,7 +71,7 @@ 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-southeast-1']
# * region<~String> - optional region to use. For instance, 'eu-west-1', 'us-east-1' and etc.
#
# ==== Returns
# * SQS object with connection to AWS.
@ -83,20 +83,10 @@ module Fog
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
options[:region] ||= 'us-east-1'
@host = options[:host] || case options[:region]
when 'ap-southeast-1'
'ap-southeast-1.queue.amazonaws.com'
when 'eu-west-1'
'eu-west-1.queue.amazonaws.com'
when 'us-east-1'
'queue.amazonaws.com'
when 'us-west-1'
'us-west-1.queue.amazonaws.com'
when 'us-west-2'
'us-west-2.queue.amazonaws.com'
when 'sa-east-1'
'sa-east-1.queue.amazonaws.com'
else
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
"#{options[:region]}.queue.amazonaws.com"
end
@path = options[:path] || '/'
@persistent = options[:persistent] || false