summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-10-26 11:33:51 -0700
committerPete Higgins <pete@peterhiggins.org>2020-10-26 11:33:51 -0700
commitb58460543a03e5e317637315b647d7ed74f0380f (patch)
treef7c56c5a858047f87026d6225e9400e5c9bdea1a
parent29765adb7174256880d574c36435a78ce8272d5d (diff)
downloadchef-b58460543a03e5e317637315b647d7ed74f0380f.tar.gz
Remove unused monkeypatch on net/http.remove-net-http-monkeypatch
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--lib/chef/application/knife.rb2
-rw-r--r--lib/chef/cookbook_site_streaming_uploader.rb2
-rw-r--r--lib/chef/http.rb4
-rw-r--r--lib/chef/http/basic_client.rb2
-rw-r--r--lib/chef/http/http_request.rb2
-rw-r--r--lib/chef/http/socketless_chef_zero_client.rb2
-rw-r--r--lib/chef/monkey_patches/net_http.rb22
7 files changed, 7 insertions, 29 deletions
diff --git a/lib/chef/application/knife.rb b/lib/chef/application/knife.rb
index eb1c3279e1..7906ce6eaa 100644
--- a/lib/chef/application/knife.rb
+++ b/lib/chef/application/knife.rb
@@ -20,7 +20,7 @@ require_relative "../application"
require "mixlib/log"
require "ohai/config"
module Net
- autoload :HTTP, File.expand_path("../monkey_patches/net_http", __dir__)
+ autoload :HTTP, "net/http"
end
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb
index 65b27fed1d..d7226b79b3 100644
--- a/lib/chef/cookbook_site_streaming_uploader.rb
+++ b/lib/chef/cookbook_site_streaming_uploader.rb
@@ -20,7 +20,7 @@
autoload :URI, "uri"
module Net
- autoload :HTTP, File.expand_path("monkey_patches/net_http", __dir__)
+ autoload :HTTP, "net/http"
end
autoload :OpenSSL, "openssl"
module Mixlib
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 619cdbecec..af3aacc127 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -25,8 +25,8 @@ require "tempfile" unless defined?(Tempfile)
autoload :OpenSSL, "openssl"
autoload :URI, "uri"
module Net
- autoload :HTTP, File.expand_path("monkey_patches/net_http", __dir__)
- autoload :HTTPClientException, File.expand_path("monkey_patches/net_http", __dir__)
+ autoload :HTTP, "net/http"
+ autoload :HTTPClientException, "net/http"
end
require_relative "http/basic_client"
require_relative "config"
diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb
index f4be3b98ec..2513b750eb 100644
--- a/lib/chef/http/basic_client.rb
+++ b/lib/chef/http/basic_client.rb
@@ -22,7 +22,7 @@
#
autoload :URI, "uri"
module Net
- autoload :HTTP, File.expand_path("../monkey_patches/net_http", __dir__)
+ autoload :HTTP, "net/http"
end
require_relative "ssl_policies"
require_relative "http_request"
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index e6952aed9e..a188fe947e 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -23,7 +23,7 @@
autoload :URI, "uri"
autoload :CGI, "cgi"
module Net
- autoload :HTTP, File.expand_path("../monkey_patches/net_http", __dir__)
+ autoload :HTTP, "net/http"
end
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
diff --git a/lib/chef/http/socketless_chef_zero_client.rb b/lib/chef/http/socketless_chef_zero_client.rb
index 9664f6feed..8c7ee8d8bc 100644
--- a/lib/chef/http/socketless_chef_zero_client.rb
+++ b/lib/chef/http/socketless_chef_zero_client.rb
@@ -46,7 +46,7 @@
require "chef_zero/server"
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
module Net
- autoload :HTTPResponse, File.expand_path("../monkey_patches/net_http", __dir__)
+ autoload :HTTPResponse, "net/http"
end
class Chef
diff --git a/lib/chef/monkey_patches/net_http.rb b/lib/chef/monkey_patches/net_http.rb
deleted file mode 100644
index 5955f1c6d2..0000000000
--- a/lib/chef/monkey_patches/net_http.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Module gets mixed in to Net::HTTP exception classes so we can attach our
-# RESTRequest object to them and get the request parameters back out later.
-module ChefNetHTTPExceptionExtensions
- attr_accessor :chef_rest_request
-end
-
-require "net/http" unless defined?(Net::HTTP)
-module Net
- class HTTPError < Net::ProtocolError
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPRetriableError < Net::ProtoRetriableError
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPClientException < Net::ProtoServerError
- include ChefNetHTTPExceptionExtensions
- end
- class HTTPFatalError < Net::ProtoFatalError
- include ChefNetHTTPExceptionExtensions
- end
-end