Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.9.8
-
Component/s: Chef Client
-
Labels:None
Description
node.recipe? method was removed, but no decent alternative is present. node[:recipes] include only recipes from the run_list, so in order to check for loaded recipes (e.g. by include_recipe) one must revert to using run_state.
Original ticket (CHEF-232)
When writing interdependent recipes, it would be good to easily determine if a recipe has been seen, via include_recipe, so behavior can be changed easily depending on the other recipes used.
Currently, this could work:
node.run_state[:seen_recipes].has_key?('some_recipe')
But that's rather cumbersome. This would be cleaner:
node.recipe?('some_recipe')
Resolved by http://github.com/akzhan/chef/commit/5bf1a0960f0a98d4b0a219cb88c824d4fa883dfd