summaryrefslogtreecommitdiff
path: root/chef
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2008-10-10 13:37:54 -0700
committerAdam Jacob <adam@hjksolutions.com>2008-10-10 13:37:54 -0700
commit983614b3d5fd11894788bda7e6b8d6f9b2447d38 (patch)
tree3e38884365fe174af9bf5c6d8d6f86a8f587104e /chef
parent66ba146784bcc3801112e2cd516bb2d198f2bd0a (diff)
downloadchef-983614b3d5fd11894788bda7e6b8d6f9b2447d38.tar.gz
Setting the response object to the result of the block passed to http.request
Diffstat (limited to 'chef')
-rw-r--r--chef/lib/chef/rest.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/chef/lib/chef/rest.rb b/chef/lib/chef/rest.rb
index 2f9ec992a5..2b1582ce47 100644
--- a/chef/lib/chef/rest.rb
+++ b/chef/lib/chef/rest.rb
@@ -117,7 +117,7 @@ class Chef
Chef::Log.debug("Sending HTTP Request via #{req.method} to #{req.path}")
res = nil
tf = nil
- http.request(req) do |response|
+ res = http.request(req) do |response|
if raw
tf = Tempfile.new("chef-rest")
# Stolen from http://www.ruby-forum.com/topic/166423
@@ -133,7 +133,7 @@ class Chef
else
response.read_body
end
- res = response
+ response
end
if res.kind_of?(Net::HTTPSuccess)