summaryrefslogtreecommitdiff
path: root/lib/ohai/system.rb
diff options
context:
space:
mode:
authorClaire McQuin <claire@opscode.com>2013-09-06 09:45:14 -0700
committerClaire McQuin <claire@opscode.com>2013-09-06 11:34:05 -0700
commite13c9f83e4d73e08c7ea713a4f883603edb98c0c (patch)
tree4bab44e05fd1f17e6810545e9f5c1d697e6531a1 /lib/ohai/system.rb
parent43f4bf4a28ebc2bc4c02a3531d47fc731e153ce9 (diff)
downloadohai-e13c9f83e4d73e08c7ea713a4f883603edb98c0c.tar.gz
run v6 plugins that depend on v7 plugins in Ohai::System#run_plugins, #require_plugin
Diffstat (limited to 'lib/ohai/system.rb')
-rw-r--r--lib/ohai/system.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index a906d332..13279c12 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -156,10 +156,13 @@ module Ohai
if plugin = @v6_dependency_solver[plugin_name] or plugin = plugin_for(plugin_name)
begin
- plugin.safe_run
+ plugin.version.eql?(:version7) ? @runner.run_plugin(plugin, force) : plugin.safe_run
true
rescue SystemExit, Interrupt
raise
+ rescue DependencyCycleError, NoAttributeError => e
+ Ohai::Log.error("Encountered error while running plugins: #{e.inspect}")
+ raise
rescue Exception,Errno::ENOENT => e
Ohai::Log.debug("Plugin #{plugin_name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
end