1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #2173 from burns/remove_deprecated_block_os

[openstack|storage] remove deprecated response block from request
This commit is contained in:
Wesley Beary 2013-09-24 12:20:46 -07:00
commit f87416f91d
2 changed files with 10 additions and 10 deletions

View file

@ -10,17 +10,17 @@ module Fog
# * object<~String> - Name of object to look for
#
def get_object(container, object, &block)
params = {}
if block_given?
params[:response_block] = Proc.new
end
request(params.merge!({
params = {
:expects => 200,
:method => 'GET',
:path => "#{Fog::OpenStack.escape(container)}/#{Fog::OpenStack.escape(object)}"
}), false)
}
if block_given?
params[:response_block] = block
end
request(params, false)
end
end

View file

@ -140,7 +140,7 @@ module Fog
@path = @original_path
end
def request(params, parse_json = true, &block)
def request(params, parse_json = true)
begin
response = @connection.request(params.merge({
:headers => {
@ -149,7 +149,7 @@ module Fog
}.merge!(params[:headers] || {}),
:host => @host,
:path => "#{@path}/#{params[:path]}",
}), &block)
}))
rescue Excon::Errors::Unauthorized => error
if error.response.body != 'Bad username or password' # token expiration
@openstack_must_reauthenticate = true