[chef] Re: Accessing Node Object in Libraries


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To: " " < >
  • Subject: [chef] Re: Accessing Node Object in Libraries
  • Date: Fri, 16 May 2014 09:34:09 -0500

"Should you": that's an architectural question for our developers, presumably. You're right -- I usually pass either the node object itself or the attributes thereof to a helper, if I need them:

https://github.com/juliandunn/oracle-instantclient/blob/master/libraries/utils.rb#L26

- Julian


On Fri, May 16, 2014 at 9:10 AM, Stewart, Curtis < " target="_blank"> > wrote:
Should I always be able to access the node object in libraries?  Julian Dunn wrote a great post on writing libraries here, but there’s no reference to a node object.  

Unfortunately, I don’t have a specific example, but I know I’ve come across cases where I have to pass the node object from a recipe into a library method because the library didn’t know about the node object itself.  I believe the differences come into play when you create a proper library using ruby modules (as in Julian’s post) vs. just adding helper methods with no namespacing.


Curtis Stewart
Consultant
Skype cstewart8710

 




Cloud Migration - Architecture - DevOps - Big Data - App Dev




--
[ Julian C. Dunn < " target="_blank"> >          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ]
[ gopher://sdf.org/1/users/keymaker/           * compliant!    ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]



Archive powered by MHonArc 2.6.16.

§