diff options
Diffstat (limited to 'lib/ohai/system.rb')
-rw-r--r-- | lib/ohai/system.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb index f844504c..6d941b45 100644 --- a/lib/ohai/system.rb +++ b/lib/ohai/system.rb @@ -83,6 +83,13 @@ module Ohai @runner.run_plugin(v6plugin) end + # Users who are migrating from ohai 6 may give one or more Ohai 6 plugin + # names as the +attribute_filter+. In this case we return early because + # the v7 plugin provides map will not have an entry for this plugin. + if attribute_filter and Array(attribute_filter).all? {|filter_item| have_v6_plugin?(filter_item) } + return true + end + # Then run all the version 7 plugins begin @provides_map.all_plugins(attribute_filter).each { |plugin| @@ -94,6 +101,10 @@ module Ohai end end + def have_v6_plugin?(name) + @v6_dependency_solver.values.any? {|v6plugin| v6plugin.name == name } + end + def pathify_v6_plugin(plugin_name) path_components = plugin_name.split("::") File.join(path_components) + ".rb" |