summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-03-15 11:06:05 +0000
committerGitHub <noreply@github.com>2018-03-15 11:06:05 +0000
commit8dda5308ac1701ce8c7831844455df70528ca37e (patch)
treed1a0c36ccf97bba63e86fda3e35d014818bfa24f
parentdf58c0ea31653c9ca601ce4154fc964946b27455 (diff)
parent5252de51361c1fbba777bc39b0fdc113e6f7643c (diff)
downloadohai-8dda5308ac1701ce8c7831844455df70528ca37e.tar.gz
Merge pull request #1160 from chef/chef_packages_updates
Minor updates to the Ohai/Chef plugins
-rw-r--r--lib/ohai/plugins/chef.rb3
-rw-r--r--lib/ohai/plugins/ohai.rb2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/ohai/plugins/chef.rb b/lib/ohai/plugins/chef.rb
index 211a320e..fe8b49e6 100644
--- a/lib/ohai/plugins/chef.rb
+++ b/lib/ohai/plugins/chef.rb
@@ -23,10 +23,11 @@ Ohai.plugin(:Chef) do
begin
require "chef/version"
rescue Gem::LoadError
+ Ohai::Log.debug("Plugin Chef: Unable to load the chef gem to determine the version")
# this catches when you've done a major version bump of ohai, but
# your chef gem is incompatible, so we can't load it in the same VM
# (affects mostly internal testing)
- next
+ next # avoids us writing an empty mash
end
chef_packages Mash.new unless chef_packages
diff --git a/lib/ohai/plugins/ohai.rb b/lib/ohai/plugins/ohai.rb
index 9cadb480..3b6ed737 100644
--- a/lib/ohai/plugins/ohai.rb
+++ b/lib/ohai/plugins/ohai.rb
@@ -20,8 +20,6 @@ Ohai.plugin(:Ohai) do
provides "chef_packages/ohai"
collect_data do
- require "ohai"
-
chef_packages Mash.new unless chef_packages
chef_packages[:ohai] = Mash.new
chef_packages[:ohai][:version] = Ohai::VERSION