diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-07 10:05:59 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-01-07 10:05:59 -0800 |
commit | a6ce4ee1d3abb15b633ee01b779aa92317ea3aa9 (patch) | |
tree | 46a1ce734aedfd32b43ce28dd221cad77fe44348 /lib/ohai/runner.rb | |
parent | a43137a5432cd2e53c6d7adbae11c67d2a9fd3ca (diff) | |
download | ohai-a6ce4ee1d3abb15b633ee01b779aa92317ea3aa9.tar.gz |
rescue exceptions thrown collecting data
back out the require 'sigar' hack
Diffstat (limited to 'lib/ohai/runner.rb')
-rw-r--r-- | lib/ohai/runner.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb index 4b654d66..157b96b1 100644 --- a/lib/ohai/runner.rb +++ b/lib/ohai/runner.rb @@ -42,13 +42,17 @@ module Ohai return false end - case plugin.version - when :version7 - run_v7_plugin(plugin, force) - when :version6 - run_v6_plugin(plugin, force) - else - raise ArgumentError, "Invalid plugin version #{plugin.version} for plugin #{plugin}" + begin + case plugin.version + when :version7 + run_v7_plugin(plugin, force) + when :version6 + run_v6_plugin(plugin, force) + else + raise ArgumentError, "Invalid plugin version #{plugin.version} for plugin #{plugin}" + end + rescue Exception,Errno::ENOENT => e + Ohai::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}") end end |