mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Update call to include response_block rather than passing a block, to conform to excon deprecation message.
Fix code when block is not passed.
This commit is contained in:
parent
dab0fcc33f
commit
2c37b04860
1 changed files with 15 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue