[chef] Re: Re: Re: cookbook name as an attribute


Chronological Thread 
  • From: Tim Cook < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: cookbook name as an attribute
  • Date: Mon, 2 Dec 2013 17:44:47 +0000
  • Accept-language: en-US

Why am I unable to pass the cookbook as an instance variable to a library class ? 


On Monday, December 2, 2013 at 9:28 AM, Adam Mielke wrote:
Within a cookbook the variable "cookbook_name" should contain its own name.

This won’t be true in library files, they are evaluated with Ruby’s `load` function so they don’t have the same contextual stuff that recipes do.

The best you can do here is look at `__FILE__` and infer the cookbook name from the file path. 

Adam Mielke
System Engineer
Research Computing and Engineering / College of Liberal Arts
University of Minnesota



On Mon, Dec 2, 2013 at 11:11 AM, Tim Cook < " target="_blank"> > wrote:
I am trying to pass the cookbook name to the logger via a library  and have not been able to figure out how to pull that attribute, does anyone know how a cookbook calls its self in the form of an attribute ? 



-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§