[chef] Re: LWRP prevents code-reuse...


Chronological Thread 
  • From: AJ Christensen < >
  • To:
  • Subject: [chef] Re: LWRP prevents code-reuse...
  • Date: Wed, 30 Jun 2010 10:56:11 +1200

Chuck it in a library

On 30 June 2010 00:23, Ringo De Smet < "> > wrote:
Hello,

Within our company, we use PyLabs (1). This environment has it's own
packaging system (qpackages) and it's own shell (qshell) based on
ipython. I started a cookbook to install the base environment, and
that was quickly done. However, I have more problems with the custom
resources and providers I am trying to implement:

1) a custom resource named "pylabs_qshell", based upon the "script"
resource, similar to "bash" and "python".
2) a custom resource named "pylabs_package", based on the standard
"Package" resource
3) a custom provider named "pylabs_package", extending the standard
"Package" provider

However, after several try-outs, I ended up looking in the core Chef
code to see how custom resources/providers worked. If someone packages
resources/providers in the cookbook, you seem to be obliged to use the
Light-Weight Resource Provider syntax. The generated classes in LWRP
are just Resources, not the Script or Package I want it to be. Similar
problem for the custom Provider.

Eventually, I replaced the LWRP syntax with full-fledged resource and
provider classes, but the build_from_file didn't seem to like it. What
is my best option to go forward?

Greetings,

Ringo

(1) http://www.pylabs.org




Archive powered by MHonArc 2.6.16.

§