From 34efabbe4871b05b00f6352fcb5c641b880d889c Mon Sep 17 00:00:00 2001 From: Pavel Repin Date: Thu, 2 Feb 2012 15:46:42 -0800 Subject: [PATCH] Nix hardcoded regions: S3 (us-east-1 is special). --- lib/fog/aws/storage.rb | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/lib/fog/aws/storage.rb b/lib/fog/aws/storage.rb index 483265241..46d7ecaa8 100644 --- a/lib/fog/aws/storage.rb +++ b/lib/fog/aws/storage.rb @@ -192,24 +192,10 @@ module Fog @aws_secret_access_key = options[:aws_secret_access_key] options[:region] ||= 'us-east-1' @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' '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 - raise ArgumentError, "Unknown region: #{options[:region].inspect}" + "s3-#{options[:region]}.amazonaws.com" end @region = options[:region] end @@ -270,22 +256,10 @@ module Fog else options[:region] ||= 'us-east-1' @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' '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 - raise ArgumentError, "Unknown region: #{options[:region].inspect}" + "s3-#{options[:region]}.amazonaws.com" end @path = options[:path] || '/' @persistent = options[:persistent] || true