- From: "
" <
>
- To: "
" <
>
- Subject: [chef] RE: Re: Custom LWRP Un-initialized Constant error
- Date: Wed, 28 Jan 2015 18:01:29 +0000
- Accept-language: en-GB, en-US
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
Thanks
-----Original Message-----
From: Daniel DeLeo
[mailto:
On Behalf Of Daniel DeLeo
Sent: 28 January 2015 17:35
To:
Subject: [chef] Re: Custom LWRP Un-initialized Constant error
On Wednesday, January 28, 2015 at 9:27 AM,
wrote:
>
Good Afternoon/evening/morning,
>
I’m having a little trouble writing a custom LWRP. It’s pretty simple as
>
I’m trying to get my head round how @current_resource works.
>
Here’s the code followed by the error; any ideas what I’m doing wrong?
>
(this LWRP is contained in an library cookbook called AirWatch)
You’re really close. What’s going on here is that Chef prepends the cookbook
name to the LWRP name to generate the class name for the resource. E.g., in
the `java` cookbook there is an `ark` LWRP, which becomes ‘JavaArk’. Based on
your mail, it looks like your resource is in air_watch/resources/test.rb ? In
that case it should be AirWatchTest.
HTH,
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.