summaryrefslogtreecommitdiff
path: root/lib/chef/run_list
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/run_list
parent1b71aeb423b009f6d1a44215c89e9976957b47e9 (diff)
downloadchef-d99e306a41b1402209d320cb7119b12a3bbb962f.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/run_list')
-rw-r--r--lib/chef/run_list/run_list_expansion.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/run_list/run_list_expansion.rb b/lib/chef/run_list/run_list_expansion.rb
index 64e4326fb8..2f2d170446 100644
--- a/lib/chef/run_list/run_list_expansion.rb
+++ b/lib/chef/run_list/run_list_expansion.rb
@@ -21,7 +21,7 @@ require 'chef/mash'
require 'chef/mixin/deep_merge'
require 'chef/role'
-require 'chef/rest'
+require 'chef/server_api'
require 'chef/json_compat'
class Chef
@@ -45,7 +45,7 @@ class Chef
attr_reader :missing_roles_with_including_role
# The data source passed to the constructor. Not used in this class.
- # In subclasses, this is a couchdb or Chef::REST object pre-configured
+ # In subclasses, this is a Chef::ServerAPI object pre-configured
# to fetch roles from their correct location.
attr_reader :source
@@ -214,11 +214,11 @@ class Chef
class RunListExpansionFromAPI < RunListExpansion
def rest
- @rest ||= (source || Chef::REST.new(Chef::Config[:chef_server_url]))
+ @rest ||= (source || Chef::ServerAPI.new(Chef::Config[:chef_server_url]))
end
def fetch_role(name, included_by)
- rest.get_rest("roles/#{name}")
+ Chef::Role.from_hash(rest.get("roles/#{name}"))
rescue Net::HTTPServerException => e
if e.message == '404 "Not Found"'
role_not_found(name, included_by)