From 968b757949e4175f6869721cef104fb467a4df03 Mon Sep 17 00:00:00 2001 From: Pavel Repin Date: Thu, 2 Feb 2012 15:27:54 -0800 Subject: [PATCH] Nix hardcoded regions: SNS. --- lib/fog/aws/sns.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/fog/aws/sns.rb b/lib/fog/aws/sns.rb index af361b561..b3f8b19cc 100644 --- a/lib/fog/aws/sns.rb +++ b/lib/fog/aws/sns.rb @@ -56,22 +56,7 @@ 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' - 'sns.ap-southeast-1.amazonaws.com' - when 'eu-west-1' - 'sns.eu-west-1.amazonaws.com' - when 'us-east-1' - 'sns.us-east-1.amazonaws.com' - when 'us-west-1' - 'sns.us-west-1.amazonaws.com' - when 'us-west-2' - 'sns.us-west-2.amazonaws.com' - when 'sa-east-1' - 'sns.sa-east-1.amazonaws.com' - else - raise ArgumentError, "Unknown region: #{options[:region].inspect}" - end + @host = options[:host] || "sns.#{options[:region]}.amazonaws.com" @path = options[:path] || '/' @persistent = options[:persistent] || false