diff options
author | Jesse Campbell <hikeit@gmail.com> | 2013-03-01 21:11:31 -0500 |
---|---|---|
committer | Jesse Campbell <hikeit@gmail.com> | 2013-03-01 21:11:31 -0500 |
commit | 7d9c7ac2ba438d534e038dcc0d73248f9faa387d (patch) | |
tree | a91904d146530114729f08451e36449d9056926f /lib/chef/rest.rb | |
parent | a2faf73b16726fef02dd644437105d05c7700bf1 (diff) | |
download | chef-7d9c7ac2ba438d534e038dcc0d73248f9faa387d.tar.gz |
switch back to chef::rest
Diffstat (limited to 'lib/chef/rest.rb')
-rw-r--r-- | lib/chef/rest.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/rest.rb b/lib/chef/rest.rb index 21be437e24..8f5405f9d2 100644 --- a/lib/chef/rest.rb +++ b/lib/chef/rest.rb @@ -84,6 +84,10 @@ class Chef @raw_key end + def last_response + @last_response + end + # Send an HTTP GET request to the path # # Using this method to +fetch+ a file is considered deprecated. @@ -164,6 +168,7 @@ class Chef retriable_rest_request(method, url, body, headers) do |rest_request| begin response = rest_request.call {|r| r.read_body} + @last_response = response Chef::Log.debug("---- HTTP Status and Header Data: ----") Chef::Log.debug("HTTP #{response.http_version} #{response.code} #{response.msg}") @@ -248,6 +253,7 @@ class Chef tempfile = stream_to_tempfile(url, r) end end + @last_response = response if response.kind_of?(Net::HTTPSuccess) tempfile elsif redirect_location = redirected_to(response) |