lib/ohai/system.rb in ohai-8.24.1 vs lib/ohai/system.rb in ohai-8.25.0
- old
+ new
@@ -40,10 +40,11 @@
attr_reader :v6_dependency_solver
def initialize(config = {})
@plugin_path = ""
@config = config
+ @failed_plugins = []
reset_system
end
def reset_system
@data = Mash.new
@@ -99,9 +100,14 @@
@runner.run_plugin(plugin)
end
rescue Ohai::Exceptions::AttributeNotFound, Ohai::Exceptions::DependencyCycle => e
Ohai::Log.error("Encountered error while running plugins: #{e.inspect}")
raise
+ end
+ critical_failed = Ohai::Config.ohai[:critical_plugins] & @runner.failed_plugins
+ unless critical_failed.empty?
+ msg = "The following Ohai plugins marked as critical failed: #{critical_failed}. Exiting."
+ raise Ohai::Exceptions::CriticalPluginFailure, msg
end
end
def have_v6_plugin?(name)
@v6_dependency_solver.values.any? { |v6plugin| v6plugin.name == name }