From 9526938650beeb137c41b039f146740317724407 Mon Sep 17 00:00:00 2001 From: Wesley Beary Date: Wed, 27 Jan 2010 20:22:22 -0800 Subject: [PATCH] default to non-persistent connections --- lib/fog/aws/ec2.rb | 2 +- lib/fog/aws/s3.rb | 2 +- lib/fog/aws/simpledb.rb | 2 +- lib/fog/slicehost.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fog/aws/ec2.rb b/lib/fog/aws/ec2.rb index 30fa91856..6e9d156cf 100644 --- a/lib/fog/aws/ec2.rb +++ b/lib/fog/aws/ec2.rb @@ -137,7 +137,6 @@ module Fog @host = options[:host] || 'ec2.amazonaws.com' @port = options[:port] || 443 @scheme = options[:scheme] || 'https' - @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") end private @@ -152,6 +151,7 @@ module Fog end def request(params, parser) + @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") params.merge!({ 'AWSAccessKeyId' => @aws_access_key_id, 'SignatureMethod' => 'HmacSHA256', diff --git a/lib/fog/aws/s3.rb b/lib/fog/aws/s3.rb index 62b6edb67..9c546ae4e 100644 --- a/lib/fog/aws/s3.rb +++ b/lib/fog/aws/s3.rb @@ -69,7 +69,6 @@ module Fog @host = options[:host] || 's3.amazonaws.com' @port = options[:port] || 443 @scheme = options[:scheme] || 'https' - @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") end private @@ -96,6 +95,7 @@ module Fog end def request(params) + @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") params[:headers]['Date'] = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S +0000") params[:headers]['Authorization'] = "AWS #{@aws_access_key_id}:#{signature(params)}" diff --git a/lib/fog/aws/simpledb.rb b/lib/fog/aws/simpledb.rb index 6e2cada09..cfaa4fa06 100644 --- a/lib/fog/aws/simpledb.rb +++ b/lib/fog/aws/simpledb.rb @@ -58,7 +58,6 @@ module Fog @nil_string = options[:nil_string]|| 'nil' @port = options[:port] || 443 @scheme = options[:scheme] || 'https' - @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") end private @@ -117,6 +116,7 @@ module Fog end def request(params, parser) + @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") params.merge!({ 'AWSAccessKeyId' => @aws_access_key_id, 'SignatureMethod' => 'HmacSHA256', diff --git a/lib/fog/slicehost.rb b/lib/fog/slicehost.rb index 152448b54..885bc7672 100644 --- a/lib/fog/slicehost.rb +++ b/lib/fog/slicehost.rb @@ -36,10 +36,10 @@ module Fog @host = options[:host] || "api.slicehost.com" @port = options[:port] || 443 @scheme = options[:scheme] || 'https' - @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") end def request(params) + @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") headers = { 'Authorization' => "Basic #{Base64.encode64(@password).gsub("\n",'')}" }