diff options
author | Thom May <thom@may.lt> | 2018-02-19 18:09:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-19 18:09:35 +0000 |
commit | 56be8ea4bbe792645dc8fbd86f14183c9923e3bb (patch) | |
tree | 3f6b4ffe41e94c296a0a5cf5d62974d933e6c102 | |
parent | 121718365ee4b092e9057ffaf367e3ed0475c33f (diff) | |
parent | 7994ede6a075d6b6599927a1bf1c5fd6ecfdb2b3 (diff) | |
download | chef-56be8ea4bbe792645dc8fbd86f14183c9923e3bb.tar.gz |
Merge pull request #6867 from chef/tm/fix_ohai_tests
fix ohai tests after require_plugin removal
-rw-r--r-- | lib/chef/knife/configure.rb | 4 | ||||
-rw-r--r-- | spec/unit/knife/configure_spec.rb | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index 10ae62b6c9..b277a14a3e 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -131,9 +131,7 @@ EOH def guess_servername o = Ohai::System.new - o.load_plugins - o.require_plugin "os" - o.require_plugin "hostname" + o.all_plugins(%w{ os hostname fqdn }) o[:fqdn] || o[:machinename] || o[:hostname] || "localhost" end diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb index f1d3bd0745..27bb0d9a3f 100644 --- a/spec/unit/knife/configure_spec.rb +++ b/spec/unit/knife/configure_spec.rb @@ -26,8 +26,7 @@ describe Chef::Knife::Configure do let(:ohai) do o = {} - allow(o).to receive(:require_plugin) - allow(o).to receive(:load_plugins) + allow(o).to receive(:all_plugins).with(%w{ os hostname fqdn }) o[:fqdn] = fqdn o end |