[chef] Difference node.recipe? / node.recipes[].include?


Chronological Thread 
  • From: Steffen Gebert < >
  • To:
  • Subject: [chef] Difference node.recipe? / node.recipes[].include?
  • Date: Sun, 8 Jul 2012 14:15:39 +0200

Hi,

I'm a ruby newbie, so please forgive me, if my question is caused by just not knowing the language I use. But I'm not that confident ;)

node.recipe?("recipe-name") should return, whether a recipe is .. what?
* included in the run list?
* included in the expanded run list?
* already seen in the current chef run?

It's e.g. used in the chef-client::config recipe [1] to determine, whether it runs on a chef-server. However, it didn't work for me, as chef-client recipe is prior to chef-server in the run list.

Using node["recipes"].include? worked for me. So is this the expanded run list and would node.run_state[:seen_recipes].has_key? equivalent to node.recipe?

If so, should I open a pull request for the chef-client recipe?

Thanks!
Steffen
-- 


  • [chef] Difference node.recipe? / node.recipes[].include?, Steffen Gebert, 07/08/2012

Archive powered by MHonArc 2.6.16.

§