summaryrefslogtreecommitdiff
path: root/lib/chef/knife.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/knife.rb
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/knife.rb')
-rw-r--r--lib/chef/knife.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index 2820f58e85..34e437c82f 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -26,14 +26,16 @@ require 'chef/mixin/path_sanity'
require 'chef/knife/core/subcommand_loader'
require 'chef/knife/core/ui'
require 'chef/local_mode'
-require 'chef/rest'
+require 'chef/server_api'
require 'chef/http/authenticator'
+require 'chef/http/http_request'
+require 'chef/http'
require 'pp'
class Chef
class Knife
- Chef::REST::RESTRequest.user_agent = "Chef Knife#{Chef::REST::RESTRequest::UA_COMMON}"
+ Chef::HTTP::HTTPRequest.user_agent = "Chef Knife#{Chef::HTTP::HTTPRequest::UA_COMMON}"
include Mixlib::CLI
include Chef::Mixin::PathSanity
@@ -551,15 +553,15 @@ class Chef
def rest
@rest ||= begin
- require 'chef/rest'
- Chef::REST.new(Chef::Config[:chef_server_url])
+ require 'chef/server_api'
+ Chef::ServerAPI.new(Chef::Config[:chef_server_url])
end
end
def noauth_rest
@rest ||= begin
- require 'chef/rest'
- Chef::REST.new(Chef::Config[:chef_server_url], false, false)
+ require 'chef/http/simple_json'
+ Chef::HTTP::SimpleJSON.new(Chef::Config[:chef_server_url])
end
end