- From: Miquel Torres <
>
- To:
- Subject: [chef] Re: Foodcritic FC003
- Date: Tue, 27 Dec 2011 21:14:10 +0100
That would also be nicer to users of the chef-solo search lib, and
particularly of LittleChef, which *would* be able to run the recipe
;-)
2011/12/27 Alex Howells
<
>:
>
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.