summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-09 12:35:36 -0800
committerTim Smith <tsmith@chef.io>2018-03-09 12:35:36 -0800
commit11479650855de52bd38bd75f3b0219d7133e34a3 (patch)
treec4cfa672faeccb964c88566871fd780656d71060
parentdf58c0ea31653c9ca601ce4154fc964946b27455 (diff)
downloadohai-11479650855de52bd38bd75f3b0219d7133e34a3.tar.gz
Add debug logging when we can't load the chef gem
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/chef.rb3
1 files changed, 2 insertions, 1 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