Class: RuboCop::Cop::Chef::ChefDeprecations::LegacyYumCookbookRecipes

Inherits:
RuboCop::Cop
  • Object
show all
Defined in:
lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.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 'yum::elrepo'
include_recipe 'yum::epel'
include_recipe 'yum::ius'
include_recipe 'yum::remi'
include_recipe 'yum::repoforge'
include_recipe 'yum::yum'

Constant Summary collapse

MSG =
'The elrepo, epel, ius, remi, and repoforge recipes were split into their own cookbooks and the yum recipe was renamed to be default with the release of yum cookbook 3.0 (Dec 2013).'.freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



42
43
44
45
46
# File 'lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb', line 42

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