- From: "Julian C. Dunn" <
>
- To: "
" <
>
- Subject: [chef] Re: Custom LWRP Initialise Error
- Date: Thu, 24 Jul 2014 09:26:50 -0400
I assume your custom resource is in a cookbook called "dll" with the
filename "drop.rb", right?
- Julian
On Thu, Jul 24, 2014 at 7:10 AM,
<
>
wrote:
>
Morning Guys
>
>
>
>
Got a question about LWRP’s. I’m writing a library cookbook and testing
>
components of it as I go.
>
>
I’ve written an LWRP to perform a dll drop on a server.
>
>
Everything seems ok, I’ve done a lot of reading online about this and
>
managed to narrow it down to this last error.
>
>
The error is:
>
>
“[2014-07-24T06:59:57-04:00] FATAL: NameError:
>
AW_DLLDrop_dlldrop[7.1_HF05_Overlay_SAML_fix.zip] (AW_DLLDrop::default line
>
25) had an error: NameError: uninitialized constant Chef::Resource::DllDrop”
>
>
>
>
The code from the LWRP in question is:
>
>
“
>
>
def whyrun_supported?
>
>
true
>
>
end
>
>
>
>
action :drop do
>
>
converge_by("Drop #{ @new_resource}") do
>
>
perform_dll_drop
>
>
end
>
>
end
>
>
>
>
action :undo do
>
>
converge_by("Undo #{ @new_resource}") do
>
>
undo_dll_drop
>
>
end
>
>
end
>
>
>
>
def load_current_resource
>
>
@current_resource = Chef::Resource::DllDrop.new(@new_resource.name)
>
>
@current_resource.name(@new_resource.name)
>
>
end”
>
>
>
>
Can anyone shed any light on what I’m missing with this? One of my
>
colleagues has pointed out that there may be an issue with
>
@new_resource.name retuning null? Any way I can check this?
>
>
>
>
Any pointers would be great as I’m struggling a little with this.
>
>
>
>
Thanks
>
>
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.