From af666126d6cb82987e31f3b6ff008dc770586862 Mon Sep 17 00:00:00 2001 From: Brian Hartsock Date: Thu, 7 Feb 2013 09:58:13 -0500 Subject: [PATCH 1/2] [rackspace|lb] fixed issue where double paths cause API errors --- lib/fog/rackspace/load_balancers.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/rackspace/load_balancers.rb b/lib/fog/rackspace/load_balancers.rb index f6935e17d..1d31733e2 100644 --- a/lib/fog/rackspace/load_balancers.rb +++ b/lib/fog/rackspace/load_balancers.rb @@ -110,7 +110,7 @@ module Fog uri = URI.parse(options[:rackspace_lb_endpoint] || DFW_ENDPOINT) @host = uri.host @persistent = options[:persistent] || false - @path = uri.path + @path = uri.path.end_with?('/') ? uri.path.chop : uri.path @port = uri.port @scheme = uri.scheme @@ -137,6 +137,7 @@ module Fog rescue Excon::Errors::InternalServerError => error raise InternalServerError.slurp error rescue Excon::Errors::HTTPStatusError => error + puts error.inspect raise ServiceError.slurp error end unless response.body.empty? @@ -156,7 +157,6 @@ module Fog account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1] @path = "#{@path}/#{account_id}" end - end end end From 57db3e55b4ec3c256884c93b362abe5c995f05b2 Mon Sep 17 00:00:00 2001 From: Brian Hartsock Date: Thu, 7 Feb 2013 11:16:37 -0500 Subject: [PATCH 2/2] [rackspace|lb] removed puts --- lib/fog/rackspace/load_balancers.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/fog/rackspace/load_balancers.rb b/lib/fog/rackspace/load_balancers.rb index 1d31733e2..69d013f04 100644 --- a/lib/fog/rackspace/load_balancers.rb +++ b/lib/fog/rackspace/load_balancers.rb @@ -137,7 +137,6 @@ module Fog rescue Excon::Errors::InternalServerError => error raise InternalServerError.slurp error rescue Excon::Errors::HTTPStatusError => error - puts error.inspect raise ServiceError.slurp error end unless response.body.empty?