From 2c37b04860e7f3f1ff05bea21d05ac247f600403 Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Tue, 19 Jun 2012 15:22:12 -0400 Subject: [PATCH] Update call to include response_block rather than passing a block, to conform to excon deprecation message. Fix code when block is not passed. --- lib/fog/hp/requests/storage/get_object.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/fog/hp/requests/storage/get_object.rb b/lib/fog/hp/requests/storage/get_object.rb index ff0bcbaf9..8a8eeafbf 100644 --- a/lib/fog/hp/requests/storage/get_object.rb +++ b/lib/fog/hp/requests/storage/get_object.rb @@ -10,12 +10,21 @@ module Fog # * object<~String> - Name of object to look for # def get_object(container, object, &block) - response = request({ - :block => block, - :expects => 200, - :method => 'GET', - :path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}" - }, false, &block) + if block_given? + response = request( + :response_block => block, + :expects => 200, + :method => 'GET', + :path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}" + ) + else + response = request({ + :block => block, + :expects => 200, + :method => 'GET', + :path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}" + }, false, &block) + end response end