- From: Noah Kantrowitz <
>
- To: Bryan McLellan <
>
- Cc: "
" <
>
- Subject: [chef-dev] Re: CHEF-3762: LWRP DSL for subclassing needed?
- Date: Mon, 28 Jan 2013 15:06:52 -0800
On Jan 28, 2013, at 2:45 PM, Bryan McLellan wrote:
>
http://tickets.opscode.com/browse/CHEF-3762
>
>
There's been some talk about adding a DSL for subclassing LWRPs. I've heard
>
both sentiments that it would be useful and questions if it makes something
>
justifiably easier.
>
>
Can those promoting it make a case? Can anyone else soap box about their
>
own experience?
I've been pushing hard for this for a long time now. As some examples of
places this would be directly useful, I've spent part of today reviewing a
new Mercural resource/provider which has to subclass Chef::Resource::Scm and
as such can't use the simpler LWRP syntax. Another example is any of the
multitude of service resources which currently either duplicate code or use
the "heavy" syntax. Beyond just subclassing built-in pieces, the application
cookbook would gain a lot by allowing subclassing of individual sub-resources
in places where things were mostly like a standard deployment but just need a
little tweak, like (to use Django examples because that is what I'm familiar
with) a requirements.txt in a non-standard place, or setting up the database
connection a little differently. This would allow much more fine-grained
overriding than is possible right now within the bounds of the LWRP system,
and hopefully would reduce the number of times people copy-paste-fork parts
of upstream cookbooks. In my bright and glorious LWRP-ified future this will
only get more important over time, as I hope more cookbooks use LWRPs to
provide internal modularity like this, just as you would see in any other OO
API.
--Noah
Archive powered by MHonArc 2.6.16.