lib/fog/rackspace/load_balancers.rb in fog-1.9.0 vs lib/fog/rackspace/load_balancers.rb in fog-1.10.0
- old
+ new
@@ -108,11 +108,11 @@
@rackspace_must_reauthenticate = false
@connection_options = options[:connection_options] || {}
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
authenticate
@@ -123,10 +123,11 @@
#TODO - Unify code with other rackspace services
begin
response = @connection.request(params.merge!({
:headers => {
'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,
:path => "#{@path}/#{params[:path]}"
}))
@@ -154,10 +155,9 @@
credentials = Fog::Rackspace.authenticate(options, @connection_options)
@auth_token = credentials['X-Auth-Token']
account_id = credentials['X-Server-Management-Url'].match(/.*\/([\d]+)$/)[1]
@path = "#{@path}/#{account_id}"
end
-
end
end
end
end