mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[bbg|slicehost] cleanup/consistency update request
This commit is contained in:
parent
869113a75f
commit
f672badddc
2 changed files with 6 additions and 22 deletions
|
@ -63,8 +63,8 @@ module Fog
|
|||
def request(params)
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
||||
headers = {
|
||||
'Authorization' => "Basic #{Base64.encode64(@bluebox_api_key).delete("\r\n")}"
|
||||
}
|
||||
'Authorization' => "Basic #{Base64.encode64(@bluebox_api_key).chop!}"
|
||||
}.merge!(params[:headers] || {})
|
||||
case params[:method]
|
||||
when 'DELETE', 'GET', 'HEAD'
|
||||
headers['Accept'] = 'application/xml'
|
||||
|
@ -72,15 +72,7 @@ module Fog
|
|||
headers['Content-Type'] = 'application/xml'
|
||||
end
|
||||
|
||||
@connection.request({
|
||||
:body => params[:body],
|
||||
:expects => params[:expects],
|
||||
:headers => headers.merge!(params[:headers] || {}),
|
||||
:host => @host,
|
||||
:method => params[:method],
|
||||
:parser => params[:parser],
|
||||
:path => params[:path]
|
||||
})
|
||||
@connection.request({:host => @host}.merge!(params))
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -73,8 +73,8 @@ module Fog
|
|||
def request(params)
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
||||
headers = {
|
||||
'Authorization' => "Basic #{Base64.encode64(@slicehost_password).delete("\r\n")}"
|
||||
}
|
||||
'Authorization' => "Basic #{Base64.encode64(@slicehost_password).chop!}"
|
||||
}.merge!(params[:headers] || {})
|
||||
case params[:method]
|
||||
when 'DELETE', 'GET', 'HEAD'
|
||||
headers['Accept'] = 'application/xml'
|
||||
|
@ -83,15 +83,7 @@ module Fog
|
|||
end
|
||||
|
||||
begin
|
||||
response = @connection.request({
|
||||
:body => params[:body],
|
||||
:expects => params[:expects],
|
||||
:headers => headers.merge!(params[:headers] || {}),
|
||||
:host => @host,
|
||||
:method => params[:method],
|
||||
:parser => params[:parser],
|
||||
:path => params[:path]
|
||||
})
|
||||
response = @connection.request({:host => @host}.merge!(params))
|
||||
rescue Excon::Errors::Error => error
|
||||
case error
|
||||
when Excon::Errors::NotFound
|
||||
|
|
Loading…
Add table
Reference in a new issue