summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook/synchronizer.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2015-12-02 12:19:33 +0000
committerThom May <thom@chef.io>2016-01-11 15:40:42 +0000
commitd99e306a41b1402209d320cb7119b12a3bbb962f (patch)
treef65940702826deb991e6198967d3e9e96cb2857a /lib/chef/cookbook/synchronizer.rb
parent1b71aeb423b009f6d1a44215c89e9976957b47e9 (diff)
downloadchef-tm/no_more_rest.tar.gz
Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_rest
In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
Diffstat (limited to 'lib/chef/cookbook/synchronizer.rb')
-rw-r--r--lib/chef/cookbook/synchronizer.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index fc8e739d73..b499963653 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -1,5 +1,6 @@
require 'chef/client'
require 'chef/util/threaded_job_queue'
+require 'chef/server_api'
require 'singleton'
class Chef
@@ -274,7 +275,7 @@ class Chef
# downloaded to the path +destination+ which is relative to the Chef file
# cache root.
def download_file(url, destination)
- raw_file = server_api.get_rest(url, true)
+ raw_file = server_api.streaming_request(url)
Chef::Log.info("Storing updated #{destination} in the cache.")
cache.move_to(raw_file.path, destination)
@@ -286,7 +287,7 @@ class Chef
end
def server_api
- Chef::REST.new(Chef::Config[:chef_server_url])
+ Chef::ServerAPI.new(Chef::Config[:chef_server_url])
end
end