summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2017-11-14 22:02:51 -0500
committerBryan McLellan <btm@loftninjas.org>2017-11-14 22:02:51 -0500
commitecc8dd9135f63f682922d0be2a567640a5ac4826 (patch)
treee39ccf66a164442d36db632df2c0a7c5d1e682fa
parent223d9556f1b98e548f26d1ebe4b8eee5f1c98db2 (diff)
downloadchef-btm/minimal_ohai_time.tar.gz
Add ohai_time to minimal_ohai filterbtm/minimal_ohai_time
We need ohai_time to get the 'Last Check-In' time on the Chef Server. There is really no risk to including it. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
-rw-r--r--lib/chef/client.rb2
-rw-r--r--spec/unit/client_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index ed55cd791d..1211e9425e 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -602,7 +602,7 @@ class Chef
# @api private
#
def run_ohai
- filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version os os_version} : nil
+ filter = Chef::Config[:minimal_ohai] ? %w{fqdn machinename hostname platform platform_version ohai_time os os_version} : nil
ohai.all_plugins(filter)
events.ohai_completed(node)
rescue Ohai::Exceptions::CriticalPluginFailure => e
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 95f308d130..2aff7b2a71 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Client do
end
it "runs ohai with only the minimum required plugins" do
- expected_filter = %w{fqdn machinename hostname platform platform_version os os_version}
+ expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version}
expect(ohai_system).to receive(:all_plugins).with(expected_filter)
client.run_ohai
end