[chef-dev] RE: get calling recipe


Chronological Thread 
  • From: Dave Urschatz < >
  • To: Noah Kantrowitz < >
  • Cc: " " < >
  • Subject: [chef-dev] RE: get calling recipe
  • Date: Tue, 10 Jun 2014 15:33:18 +0000
  • Accept-language: en-US, en-CA

Thanks Noah.

-----Original Message-----
From: Noah Kantrowitz 
[mailto:
 
Sent: Monday, June 09, 2014 7:58 PM
To: Dave Urschatz
Cc: 

Subject: Re: [chef-dev] get calling recipe 

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.

§