- From: "
" <
>
- To: "
" <
>
- Subject: [chef] RE: Re: RE: Re: Custom LWRP Un-initialized Constant error
- Date: Fri, 30 Jan 2015 17:13:30 +0000
- Accept-language: en-GB, en-US
Thanks very much for the help Daniel, I'm off and running now :)
-----Original Message-----
From: Daniel DeLeo
[mailto:
On Behalf Of Daniel DeLeo
Sent: 28 January 2015 19:42
To:
Subject: [chef] Re: RE: Re: Custom LWRP Un-initialized Constant error
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.