From b58460543a03e5e317637315b647d7ed74f0380f Mon Sep 17 00:00:00 2001 From: Pete Higgins Date: Mon, 26 Oct 2020 11:33:51 -0700 Subject: Remove unused monkeypatch on net/http. Signed-off-by: Pete Higgins --- lib/chef/application/knife.rb | 2 +- lib/chef/cookbook_site_streaming_uploader.rb | 2 +- lib/chef/http.rb | 4 ++-- lib/chef/http/basic_client.rb | 2 +- lib/chef/http/http_request.rb | 2 +- lib/chef/http/socketless_chef_zero_client.rb | 2 +- lib/chef/monkey_patches/net_http.rb | 22 ---------------------- 7 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 lib/chef/monkey_patches/net_http.rb 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 -- cgit v1.2.1