diff options
-rw-r--r-- | lib/chef/application.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/file.rb | 8 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/shared/unit/provider/file.rb | 25 |
5 files changed, 0 insertions, 43 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 7396051678..f9735a3769 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -29,10 +29,6 @@ require "tmpdir" require "rbconfig" require "chef/application/exit_code" require "yaml" -require "resolv" -# on linux, we replace the glibc resolver with the ruby resolv library, which -# supports reloading. -require "resolv-replace" if RbConfig::CONFIG["host_os"] =~ /linux/ class Chef class Application diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb index bb0762ceb7..7f85085eeb 100644 --- a/lib/chef/provider/file.rb +++ b/lib/chef/provider/file.rb @@ -154,7 +154,6 @@ class Chef do_contents_changes do_acl_changes do_selinux - do_resolv_conf_fixup load_resource_attributes_from_file(@new_resource) end @@ -446,13 +445,6 @@ class Chef end end - def do_resolv_conf_fixup - # reload /etc/resolv.conf after we edit it -- only on linux -- and see lib/chef/application.rb - if new_resource.path == "/etc/resolv.conf" && RbConfig::CONFIG["host_os"] =~ /linux/ - Resolv::DefaultResolver.replace_resolvers [Resolv::DNS.new("/etc/resolv.conf")] - end - end - def do_acl_changes if access_controls.requires_changes? converge_by(access_controls.describe_changes) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3a05e4dbeb..ba44f7c3f7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -154,8 +154,6 @@ RSpec.configure do |config| config.filter_run_excluding :unix_only => true unless unix? config.filter_run_excluding :aix_only => true unless aix? config.filter_run_excluding :debian_family_only => true unless debian_family? - config.filter_run_excluding :linux_only => true unless linux? - config.filter_run_excluding :non_linux_only => true if linux? config.filter_run_excluding :supports_cloexec => true unless supports_cloexec? config.filter_run_excluding :selinux_only => true unless selinux_enabled? config.filter_run_excluding :requires_root => true unless root? diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 783429161a..9ba56a15e3 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -138,10 +138,6 @@ def freebsd? !!(RUBY_PLATFORM =~ /freebsd/) end -def linux? - !!(RUBY_PLATFORM =~ /linux/) -end - def debian_family? !!(ohai[:platform_family] == "debian") end diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index ee3438da70..cb539ffbc3 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -683,31 +683,6 @@ shared_examples_for Chef::Provider::File do end end - context "do_resolv_conf_fixup" do - %w{/resolv.conf /etc/resolv.con /etc/foo/resolv.conf /c/resolv.conf}.each do |path| - context "when managing #{path}" do - let(:resource_path) { path } - it "does not reload the nameservers" do - expect(Resolv::DefaultResolver).not_to receive(:replace_resolvers) - provider.send(:do_resolv_conf_fixup) - end - end - end - context "when managing /etc/resolv.conf", linux_only: true do - let(:resource_path) { "/etc/resolv.conf" } - it "reloads the nameservers on linux" do - expect(Resolv::DefaultResolver).to receive(:replace_resolvers) - provider.send(:do_resolv_conf_fixup) - end - end - context "when managing /etc/resolv.conf", non_linux_only: true do - let(:resource_path) { "/etc/resolv.conf" } - it "does not reload the nameservers on non-linux" do - expect(Resolv::DefaultResolver).not_to receive(:replace_resolvers) - provider.send(:do_resolv_conf_fixup) - end - end - end end context "action delete" do |