- From: <
>
- To:
- Subject: [[chef-dev]] Advice on writing an LWRP
- Date: Fri, 3 Jun 2011 16:46:55 -0700 (PDT)
Hello all,
I am trying to write a LWRP, and following the instructions, have something
basic working, now comes the hard part, making it do what I really want.
The main problem is I don't want to duplicate code and so want to extend a
Provider that comes with Chef (RemoteFile), but a LWP gets a class dynamically
generated for it. Is there any way to specify that the generated class in a
LWP
should extend another? I tried just plopping a whole ruby class (partially
included below) in the LWP file, but when run it fails complaining " FATAL:
NameError: uninitialized constant
#<Class:0x1024a9888>::Chef::Provider::RemoteFile" even though I had required
'chef/provider/remote_file'.
I can of course copy the methods from File and RemoteFile into my LWP, but I
don't want to do that if I can avoid it.
Thank you in advance.
Code excerpt mentioned above:
require 'chef/provider/remote_file'
class Chef
class Provider
class S3File < Chef::Provider::RemoteFile
...
end
end
end
- [[chef-dev]] Advice on writing an LWRP, npahucki, 06/03/2011
Archive powered by MHonArc 2.6.16.