summaryrefslogtreecommitdiff
path: root/lib/ohai/runner.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-16 16:45:06 +0000
committerThom May <thom@chef.io>2018-02-16 16:45:06 +0000
commit48c29a3a729f43334a890142dbba9584791bc99e (patch)
treeaac4796861fd0cb44a6848318a9163e3b00598b1 /lib/ohai/runner.rb
parent034a8a2f2ebccfc50657b8a79d73deeca4c27b17 (diff)
downloadohai-48c29a3a729f43334a890142dbba9584791bc99e.tar.gz
Support optional pluginstm/disable_noisy_neighbours
Some plugins are useful enough to ship in Ohai, but should be off by default. Those plugins can be (and are) marked as optional. Implements RFC 103 Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/ohai/runner.rb')
-rw-r--r--lib/ohai/runner.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index ba3985dc..6f623d38 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -59,6 +59,10 @@ module Ohai
end
def run_v7_plugin(plugin)
+ return true if plugin.optional? &&
+ !Ohai.config[:run_all_plugins] &&
+ !Ohai.config[:optional_plugins].include?(plugin.name)
+
visited = [ plugin ]
until visited.empty?
next_plugin = visited.pop