- From: Rajiv Ranganath <
>
- To: Noah Kantrowitz <
>
- Cc: Dave Urschatz <
>,
- Subject: [chef-dev] Re: Re: get calling recipe
- Date: Mon, 9 Jun 2014 17:40:15 -0700
Have you tried node.run_state?
Its a Hash available on the node object that you can use.
https://github.com/opscode/chef/blob/master/lib/chef/node.rb#L72
Notifications and Subscriptions can change the order in which
resources get executed. So please do keep that in mind.
See - "Chef’s dirty secret: Convergence is also Compilation"
http://erik.hollensbe.org/2013/03/16/the-chef-resource-run-queue/
Best,
Rajiv
On Mon, Jun 9, 2014 at 4:58 PM, Noah Kantrowitz
<
>
wrote:
>
There is no "calling recipe" per se, all recipes are executed independently
>
so there isn't a useful call stack if thats what you mean. You can access
>
the _current_ cookbook/recipe via cookbook_name and recipe_name.
>
>
--Noah
>
>
On Jun 9, 2014, at 1:38 PM, Dave Urschatz
>
<
>
>
wrote:
>
>
>
>
> Is there a way to get the name of a calling recipe?
>
>
>
> Say cookbook1::recipe-a has:
>
> include_recipe "cookbook2::recipe-b"
>
>
>
> Then in cookbook2::recipe-b we have:
>
> puts get_calling_recipe.name
>
>
>
> Regards,
>
> Dave
>
Archive powered by MHonArc 2.6.16.