[chef] Foodcritic FC003


Chronological Thread 
  • From: Alex Howells < >
  • To:
  • Subject: [chef] Foodcritic FC003
  • Date: Tue, 27 Dec 2011 17:14:13 +0000

    http://acrmp.github.com/foodcritic/

I was just looking at Foodcritic, and wondered about FC003...

    Modified version
    This modified example would not match the FC003 rule:

    if Chef::Config[:solo]
      Chef::Log.warn("This recipe uses search. Chef Solo does not
support search.")
    else
      nodes = search(:node, "hostname:[* TO *] AND
chef_environment:#{node.chef_environment}")
    end

Would it not be better to wrap search() globally and emit that
Chef::Log.warn() each time that function is called inside a Solo run,
and not expect each recipe to do the above?

Cheers,
 -Alex



Archive powered by MHonArc 2.6.16.

§