summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2020-02-24 10:08:18 -0800
committerGitHub <noreply@github.com>2020-02-24 10:08:18 -0800
commit8857916e1a0854b5a0dccfcf0724f461ddf50844 (patch)
tree5d62662f61af8ee9b46aa9957d78fb95205968f3
parent49580490a63618b684d509ecde64e0eff656fd7c (diff)
parentd8fbc2505da27aab787985446630999aa0eeab0f (diff)
downloadchef-8857916e1a0854b5a0dccfcf0724f461ddf50844.tar.gz
Merge pull request #9381 from chef/net_http_deprecations
Update HTTPServerException to be HTTPClientException
-rw-r--r--lib/chef/monkey_patches/net_http.rb4
-rw-r--r--lib/chef/resource/chef_vault_secret.rb2
-rw-r--r--spec/integration/knife/data_bag_show_spec.rb2
3 files changed, 2 insertions, 6 deletions
diff --git a/lib/chef/monkey_patches/net_http.rb b/lib/chef/monkey_patches/net_http.rb
index 07918a8c1f..42007d23a7 100644
--- a/lib/chef/monkey_patches/net_http.rb
+++ b/lib/chef/monkey_patches/net_http.rb
@@ -5,10 +5,6 @@ module ChefNetHTTPExceptionExtensions
attr_accessor :chef_rest_request
end
-unless defined?(Net::HTTPClientException)
- Net::HTTPClientException = Net::HTTPServerException
-end
-
require "net/http" unless defined?(Net::HTTP)
module Net
class HTTPError
diff --git a/lib/chef/resource/chef_vault_secret.rb b/lib/chef/resource/chef_vault_secret.rb
index a2292439e6..598b494afc 100644
--- a/lib/chef/resource/chef_vault_secret.rb
+++ b/lib/chef/resource/chef_vault_secret.rb
@@ -80,7 +80,7 @@ class Chef
search item.search
rescue ChefVault::Exceptions::KeysNotFound
current_value_does_not_exist!
- rescue Net::HTTPServerException => e
+ rescue Net::HTTPClientException => e
current_value_does_not_exist! if e.response_code == "404"
end
end
diff --git a/spec/integration/knife/data_bag_show_spec.rb b/spec/integration/knife/data_bag_show_spec.rb
index 42553dc478..35f12f9619 100644
--- a/spec/integration/knife/data_bag_show_spec.rb
+++ b/spec/integration/knife/data_bag_show_spec.rb
@@ -26,7 +26,7 @@ describe "knife data bag show", :workstation do
when_the_chef_server "is empty" do
it "raises error if try to retrieve it" do
- expect { knife("data bag show bag") }.to raise_error(Net::HTTPServerException)
+ expect { knife("data bag show bag") }.to raise_error(Net::HTTPClientException)
end
end