lib/ohai/runner.rb
# safe_run: set to true if this runner will run plugins in
# safe-mode. default false.
set to true if this runner will run plugins in
safe-mode. default false.
set to true if this runner will run plugins in safe - mode . default false .
def run_v7_plugin(plugin)
      visited = [ plugin ]
      while !visited.empty?
        next_plugin = visited.pop
        next if next_plugin.has_run?
        if visited.include?(next_plugin)
          raise Ohai::Exceptions::DependencyCycle, "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, plugin).join(", ") }"
        end
        dependency_providers = fetch_plugins(next_plugin.dependencies)
        dependency_providers.delete_if { |dep_plugin|
          dep_plugin.has_run? || dep_plugin.eql?(next_plugin)
        }
        if dependency_providers.empty?
          @safe_run ? next_plugin.safe_run : next_plugin.run
        else
          visited << next_plugin << dependency_providers.first
        end
      end
    end
def run_v7_plugin ( plugin ) visited = [ plugin ] while ! visited . empty? next_plugin = visited . pop next if next_plugin . has_run? if visited . include? ( next_plugin ) raise Ohai :: Exceptions :: DependencyCycle , "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, plugin).join(", ") }" end dependency_providers = fetch_plugins ( next_plugin . dependencies ) dependency_providers . delete_if { | dep_plugin | dep_plugin . has_run? || dep_plugin . eql? ( next_plugin ) } if dependency_providers . empty? @safe_run ? next_plugin . safe_run : next_plugin . run else visited << next_plugin << dependency_providers . first end end end
safe_run: set to true if this runner will run plugins in
safe-mode.
safe_run : set to true if this runner will run plugins in safe - mode .
# Remove the already ran plugins from dependencies if force is not set # Also remove the plugin that we are about to run from dependencies as well.
plugin
<not_specific>