Class: RuboCop::Cop::Chef::Deprecations::LegacyYumCookbookRecipes

Inherits:
Base
  • 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'

# good
include_recipe 'yum-elrepo'
include_recipe 'yum-epel'
include_recipe 'yum-ius'
include_recipe 'yum-remi'
include_recipe 'yum-repoforge'
include_recipe '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).'
RESTRICT_ON_SEND =
[:include_recipe].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



52
53
54
55
56
# File 'lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb', line 52

def on_send(node)
  old_yum_recipe?(node) do
    add_offense(node, severity: :warning)
  end
end