mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
removing unnecessary :hosts parameters from dynect and openstack requests
This commit is contained in:
parent
0035912681
commit
3d6741d029
2 changed files with 1 additions and 5 deletions
|
@ -91,7 +91,7 @@ module Fog
|
||||||
params[:headers]['Auth-Token'] = auth_token unless params[:path] == 'Session'
|
params[:headers]['Auth-Token'] = auth_token unless params[:path] == 'Session'
|
||||||
params[:path] = "#{@path}/#{params[:path]}" unless params[:path] =~ %r{^#{Regexp.escape(@path)}/}
|
params[:path] = "#{@path}/#{params[:path]}" unless params[:path] =~ %r{^#{Regexp.escape(@path)}/}
|
||||||
|
|
||||||
response = @connection.request(params.merge!({:host => @host}))
|
response = @connection.request(params)
|
||||||
|
|
||||||
if response.body.empty?
|
if response.body.empty?
|
||||||
response.body = {}
|
response.body = {}
|
||||||
|
|
|
@ -72,7 +72,6 @@ module Fog
|
||||||
'X-Auth-Key' => @openstack_api_key,
|
'X-Auth-Key' => @openstack_api_key,
|
||||||
'X-Auth-User' => @openstack_username
|
'X-Auth-User' => @openstack_username
|
||||||
},
|
},
|
||||||
:host => uri.host,
|
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
|
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
|
||||||
})
|
})
|
||||||
|
@ -108,7 +107,6 @@ module Fog
|
||||||
:headers => {'Content-Type' => 'application/json',
|
:headers => {'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => body['access']['token']['id']},
|
'X-Auth-Token' => body['access']['token']['id']},
|
||||||
:host => uri.host,
|
|
||||||
:method => 'GET'
|
:method => 'GET'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -206,7 +204,6 @@ module Fog
|
||||||
:expects => [200, 204],
|
:expects => [200, 204],
|
||||||
:headers => {'Content-Type' => 'application/json'},
|
:headers => {'Content-Type' => 'application/json'},
|
||||||
:body => Fog::JSON.encode(request_body),
|
:body => Fog::JSON.encode(request_body),
|
||||||
:host => uri.host,
|
|
||||||
:method => 'POST',
|
:method => 'POST',
|
||||||
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
|
||||||
})
|
})
|
||||||
|
@ -221,7 +218,6 @@ module Fog
|
||||||
:headers => {'Content-Type' => 'application/json',
|
:headers => {'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json',
|
'Accept' => 'application/json',
|
||||||
'X-Auth-Token' => auth_token},
|
'X-Auth-Token' => auth_token},
|
||||||
:host => uri.host,
|
|
||||||
:method => 'GET'
|
:method => 'GET'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue