[chef] Re: Re: Using platform_family in a provider?


Chronological Thread 
  • From: Christopher Armstrong < >
  • To:
  • Subject: [chef] Re: Re: Using platform_family in a provider?
  • Date: Tue, 24 Dec 2013 20:34:30 -0500

Cool. Thanks Julian!


On Tue, Dec 24, 2013 at 5:41 PM, Julian C. Dunn < " target="_blank"> > wrote:
Hi Chris,

Providers do have access to the node object, but you must refer to it
directly e.g. node['platform_family'] . I don't believe the syntactic
sugar of platform_family? is available.

In library context you don't have access to the node object, so you
can either pass it in on object initialization (e.g.
https://github.com/socrata-cookbooks/java/blob/master/libraries/helpers.rb#L27)
or passing parameters on method invocation.

- Julian

On Tue, Dec 24, 2013 at 2:14 PM, Christopher Armstrong
< "> > wrote:
> Ohai Chefs,
>
> I'm doing some Christmas Eve hacking, and I think I'm not approaching
> something properly.
>
> Here is what I'm trying to do:
> https://github.com/socrata-cookbooks/java/pull/111/files
>
> Essentially, I need to conditionalize code in a provider based on the node's
> platform_family, but I don't believe I have access to the node objects or
> methods within a provider. I could pass it in as a parameter, but that seems
> clunky - the user of the provider shouldn't care about this detail. It's
> something I want to abstract.
>
> Could someone point me in the right direction? I still get confused about
> what Chef methods are available in recipes, libraries, providers, etc.
>
> Happy Holidays!
>
> Chris



--
[ Julian C. Dunn < "> >          * 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.

§