Class: RuboCop::Cop::Chef::ChefCorrectness::IncludingOhaiDefaultRecipe

Inherits:
RuboCop::Cop
  • Object
show all
Defined in:
lib/rubocop/cop/chef/correctness/ohai_default_recipe.rb

Overview

The Ohai default recipe previously allowed a user to ship custom Ohai plugins to a system by including them in a directory in the Ohai cookbook. This functionality was replaced with the ohai_plugin resource, which should be used instead as it doesn’t require forking the ohai cookbook.

Examples:


# bad
include_recipe 'ohai::default'
include_recipe 'ohai'

Constant Summary collapse

MSG =
"Use the ohai_plugin resource to ship custom Ohai plugins instead of using the ohai::default recipe. If you're not shipping custom Ohai plugins, then you can remove this recipe entirely".freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



38
39
40
41
42
# File 'lib/rubocop/cop/chef/correctness/ohai_default_recipe.rb', line 38

def on_send(node)
  ohai_recipe_usage?(node) do
    add_offense(node, location: :expression, message: MSG, severity: :refactor)
  end
end