- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: RE: Re: Custom LWRP Un-initialized Constant error
- Date: Wed, 28 Jan 2015 11:42:07 -0800
On Wednesday, January 28, 2015 at 10:01 AM,
wrote:
>
Hi Daniel,
>
Thanks for that, but it's still not working.
>
The library cookbook that this LWRP is declared in is called AirWatch. The
>
provider/resource file are both called chfile.rb (and located in their
>
respective directories).
>
The cookbook calling the lwrp is called awcm_upgrade and is including the
>
AirWatch cookbook.
>
If I use Chef::Resource::AirWatchChfile.new I'm still getting an error
>
"uninitialized constant" when executing the awcm_upgrade on a test node.
>
Am I calling it correctly from the awcm_upgrade cookbook?
>
>
AirWatch_Chfile 'chtest.txt' do
>
action :create
>
end
This should be snake-cased and all lower case. In Ruby, method names
(declaring a resource in a recipe is a method call on a Recipe object)
generally need to be lower case (there are exceptions, but they’re for
weirdos who like confusing code :P ). Upper case is for constants (which is
what class and module names really are). So you want to use
`air_watch_chfile`.
>
>
>
Thanks
HTH,
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.