Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-10 Thread Jeff McCune
On Mon, Sep 9, 2013 at 10:08 AM, John Bollinger wrote: > On Thursday, September 5, 2013 4:31:07 PM UTC-5, Jeff McCune wrote: > >> On Tue, Sep 3, 2013 at 12:44 PM, Luke Kanies wrote: >> >>> +1 to a function expressing containment but not declaring the class >>> (#3). It's the only option of the 4

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-10 Thread Patrick Carlisle
An implementation of the contain function is now merged into the master branch of puppet, if anyone wants to give it a try and see if it behaves as expected. I named it 'contain' not 'contains', and it accepts multiple arguments just like include. -- You received this message because you are subs

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-09 Thread John Bollinger
On Thursday, September 5, 2013 4:31:07 PM UTC-5, Jeff McCune wrote: > > On Tue, Sep 3, 2013 at 12:44 PM, Luke Kanies > > > wrote: > >> +1 to a function expressing containment but not declaring the class (#3). >> It's the only option of the 4 provided that doesn't have the side-effect >> of a

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-06 Thread Jeff McCune
Cool, thanks for the clarification. It does help think about the problem more clearly. So how about a contain() that sinply fails if it can't do what it's supposed to do because the class isn't already in the catalog? It really does seem like a problem that the side effect causes other problems i

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Andy Parker
On Thu, Sep 5, 2013 at 5:06 PM, Jeff McCune wrote: > On Thu, Sep 5, 2013 at 2:44 PM, Luke Kanies wrote: > >> >> "'include' should defer evaluation of classes with parameters in case a >> more specific evaluation is available" >> >> Right? >> > > Yes, though I've been expressing it a bit differen

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Jeff McCune
On Thu, Sep 5, 2013 at 2:44 PM, Luke Kanies wrote: > > "'include' should defer evaluation of classes with parameters in case a > more specific evaluation is available" > > Right? > Yes, though I've been expressing it a bit differently. It shouldn't matter what order I say `include foo` or `clas

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Luke Kanies
On Sep 5, 2013, at 2:31 PM, Jeff McCune wrote: > On Tue, Sep 3, 2013 at 12:44 PM, Luke Kanies wrote: >> +1 to a function expressing containment but not declaring the class (#3). >> It's the only option of the 4 provided that doesn't have the side-effect of >> adding the class to the catalog.

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Patrick Carlisle
On Thu, Sep 5, 2013 at 2:31 PM, Jeff McCune wrote: > > I mentioned a site module. Consider this example. What is the result? > > 1 class site::motd($template = 'site/motd') { > 2 notify { 'motd': message => "template is $template" } > 3 } > 4 > 5 class goal { > 6 notify { "site:

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Jeff McCune
On Tue, Sep 3, 2013 at 12:44 PM, Luke Kanies wrote: > +1 to a function expressing containment but not declaring the class (#3). > It's the only option of the 4 provided that doesn't have the side-effect > of adding the class to the catalog. I've run across situations where a > module may want t

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-05 Thread Eric Sorenson
On Sep 4, 2013, at 10:00 PM, Luke Kanies wrote: > Hmm. Maybe the list of options above is incomplete, but I read the IRC > thread differently. > > I read it as: > > If class is not included and not contained and doesn't require parameters, > contain and include > If included and not contain

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-04 Thread Luke Kanies
On Sep 4, 2013, at 5:22 PM, Eric Sorenson wrote: > On Sep 3, 2013, at 12:47 PM, Luke Kanies wrote: > >> It looks like we shouldn't need to touch the catalog stuff at all to make >> this work, so I agree. Is there a ticket out there for the catalog format >> refactoring? > > We have a Roadma

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-04 Thread Eric Sorenson
On Sep 3, 2013, at 12:47 PM, Luke Kanies wrote: > It looks like we shouldn't need to touch the catalog stuff at all to make > this work, so I agree. Is there a ticket out there for the catalog format > refactoring? We have a Roadmap JIRA issue that I've just cloned into redmine. http://proje

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Luke Kanies
On Sep 3, 2013, at 12:00 PM, Eric Sorenson wrote: > Replies inline; I've butchered the quoting but will try to keep the > attribution correct. > > [John Bollinger] Part of my premise here is that you cannot reasonably infer > from a class declaration alone -- regardless of the form of the decl

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Luke Kanies
On Sep 3, 2013, at 12:30 PM, Jeff McCune wrote: > On Tue, Sep 3, 2013 at 12:00 PM, Eric Sorenson > wrote: > [Andy] Here are the possibilities: > * resource like syntax for classes expresses containment: > class container { class { contained: parameter => value } } > * a function decla

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Jeff McCune
On Tue, Sep 3, 2013 at 12:00 PM, Eric Sorenson wrote: > [Andy] Here are the possibilities: >> > * resource like syntax for classes expresses containment: >> >> class container { class { contained: parameter => value } } >> >> * a function declares the class *and* expresses containment >

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Erik Dalén
On 3 September 2013 15:00, Eric Sorenson wrote: > Replies inline; I've butchered the quoting but will try to keep the > attribution correct. > > >> [Andy] Here are the possibilities: >> > * resource like syntax for classes expresses containment: >> >> class container { class { contained: p

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Eric Sorenson
Replies inline; I've butchered the quoting but will try to keep the attribution correct. [John Bollinger] Part of my premise here is that you cannot reasonably > infer from a class declaration alone -- regardless of the form of the > declaration -- whether its declaring class intends to contain

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread John Bollinger
On Tuesday, September 3, 2013 6:15:39 AM UTC-5, Sean Millichamp wrote: > > On Mon, 2013-09-02 at 23:50 -0700, Luke Kanies wrote: > > > However, I still disagree that fixing bugs should constitute a change > > worth upping a major rev. If it's a bug, then fixing it shouldn't be > > an incompat

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Sean Millichamp
On Mon, 2013-09-02 at 23:50 -0700, Luke Kanies wrote: > However, I still disagree that fixing bugs should constitute a change > worth upping a major rev. If it's a bug, then fixing it shouldn't be > an incompatibility, should it? I would argue that it has been the behavior for so long that fixin

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Luke Kanies
On Aug 30, 2013, at 5:13 PM, markus wrote: > >> But I also don't think there's fundamentally anything *wrong* with >> using whits, since they accurately model the notion of containment, >> with respect to order: classes have a "start", and a "finish", and >> there's stuff in between. It doesn't

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-03 Thread Luke Kanies
y Parker wrote: >>> >>>> On Fri, Aug 30, 2013 at 1:05 AM, R.I.Pienaar wrote: >>>>> >>>>> >>>>> - Original Message - >>>>> > From: "Luke Kanies" >>>>> > To: puppet-dev@go

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-02 Thread Luke Kanies
On Aug 30, 2013, at 4:33 PM, Patrick Carlisle wrote: > > On Fri, Aug 30, 2013 at 3:58 PM, Luke Kanies wrote > Hmm. I'm essentially positive that there was a version of this bug that was > caused by whits cancelling out when classes were empty, but it sounds like > that form has been fixed.

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-02 Thread Luke Kanies
On Sep 1, 2013, at 11:32 AM, "Dustin J. Mitchell" wrote: > On Wed, Aug 28, 2013 at 1:20 PM, Luke Kanies wrote: >> That implies that we can't ship it until 4.0, which would be a tragedy >> worth fighting hard to avoid. > > At the risk of sounding impertinent, I think you have it backward. > When

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-09-01 Thread Dustin J. Mitchell
On Wed, Aug 28, 2013 at 1:20 PM, Luke Kanies wrote: > That implies that we can't ship it until 4.0, which would be a tragedy > worth fighting hard to avoid. At the risk of sounding impertinent, I think you have it backward. When a desirable feature or enhancement requires a backward-incompatible

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Andy Parker
On Fri, Aug 30, 2013 at 5:13 PM, markus wrote: > > > But I also don't think there's fundamentally anything *wrong* with > > using whits, since they accurately model the notion of containment, > > with respect to order: classes have a "start", and a "finish", and > > there's stuff in between. It d

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread markus
> But I also don't think there's fundamentally anything *wrong* with > using whits, since they accurately model the notion of containment, > with respect to order: classes have a "start", and a "finish", and > there's stuff in between. It doesn't really feel like a hack to me. > Ironically, they *

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Nick Lewis
; > > > > From: "Luke Kanies" > > > > > (mailto:l...@puppetlabs.com)> > > > > > > To: puppet-dev@googlegroups.com (mailto:puppet-dev@googlegroups.com) > > > > > > Sent: Thursday, August 29, 2013 11:27:00 PM > > > > &

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Patrick Carlisle
On Fri, Aug 30, 2013 at 3:58 PM, Luke Kanies wrote > > Hmm. I'm essentially positive that there was a version of this bug that > was caused by whits cancelling out when classes were empty, but it sounds > like that form has been fixed. Either that, or the first time I did a deep > dive on this,

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Luke Kanies
> From: "Luke Kanies" >> > To: puppet-dev@googlegroups.com >> > Sent: Thursday, August 29, 2013 11:27:00 PM >> > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) >> > >> > On Aug 29, 2013, at 12:24 PM, John Boll

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread John Bollinger
On Friday, August 30, 2013 11:11:52 AM UTC-5, Andy Parker wrote: > > > Here are the possibilities: > > * resource like syntax for classes expresses containment: > > class container { class { contained: parameter => value } } > > * a function declares the class *and* expresses containmen

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Trevor Vaughan
, R.I.Pienaar wrote: > > > - Original Message - > > From: "Luke Kanies" > > To: puppet-dev@googlegroups.com > > Sent: Friday, August 30, 2013 6:34:13 PM > > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) > > > > On Aug 30, 2

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Erik Dalén
On 30 August 2013 09:55, Luke Kanies wrote: > On Aug 30, 2013, at 1:05 AM, "R.I.Pienaar" wrote: > > > > > > > - Original Message - > >> From: "Luke Kanies" > >> To: puppet-dev@googlegroups.com > >> Sent: Thursda

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Andy Parker
puppet-dev@googlegroups.com >> > Sent: Thursday, August 29, 2013 11:27:00 PM >> > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) >> > >> > On Aug 29, 2013, at 12:24 PM, John Bollinger > > >> > wrote: >> > >>

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread R.I.Pienaar
- Original Message - > From: "Luke Kanies" > To: puppet-dev@googlegroups.com > Sent: Friday, August 30, 2013 6:34:13 PM > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) > > On Aug 30, 2013, at 9:14 AM, "R.I.Pienaar"

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Luke Kanies
On Aug 30, 2013, at 1:05 AM, "R.I.Pienaar" wrote: > > > - Original Message - >> From: "Luke Kanies" >> To: puppet-dev@googlegroups.com >> Sent: Thursday, August 29, 2013 11:27:00 PM >> Subject: Re: Anchor pattern (was Re: [Puppet-

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Luke Kanies
On Aug 30, 2013, at 9:14 AM, "R.I.Pienaar" wrote: > > > - Original Message - >> From: "Erik Dalén" >> To: "Puppet Developers" >> Sent: Friday, August 30, 2013 5:07:46 PM >> Subject: Re: Anchor pattern (was Re: [Puppet-

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Luke Kanies
On Aug 30, 2013, at 9:11 AM, Andy Parker wrote: > On Fri, Aug 30, 2013 at 1:05 AM, R.I.Pienaar wrote: > > > - Original Message - > > From: "Luke Kanies" > > To: puppet-dev@googlegroups.com > > Sent: Thursday, August 29, 2013 11:27:00 PM

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Erik Dalén
On 30 August 2013 11:14, R.I.Pienaar wrote: > > > - Original Message - > > From: "Erik Dalén" > > To: "Puppet Developers" > > Sent: Friday, August 30, 2013 5:07:46 PM > > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread R.I.Pienaar
- Original Message - > From: "Erik Dalén" > To: "Puppet Developers" > Sent: Friday, August 30, 2013 5:07:46 PM > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) > > On 30 August 2013 09:55, Luke Kanies wrote: > >

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread Andy Parker
On Fri, Aug 30, 2013 at 1:05 AM, R.I.Pienaar wrote: > > > - Original Message - > > From: "Luke Kanies" > > To: puppet-dev@googlegroups.com > > Sent: Thursday, August 29, 2013 11:27:00 PM > > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Pu

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread R.I.Pienaar
- Original Message - > From: "Luke Kanies" > To: puppet-dev@googlegroups.com > Sent: Friday, August 30, 2013 3:55:57 PM > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) > > On Aug 30, 2013, at 1:05 AM, "R.I.Pienaar"

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-30 Thread R.I.Pienaar
- Original Message - > From: "Luke Kanies" > To: puppet-dev@googlegroups.com > Sent: Thursday, August 29, 2013 11:27:00 PM > Subject: Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions) > > On Aug 29, 2013, at 12:24 PM, John Bollinger > wrote

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-29 Thread Luke Kanies
On Aug 29, 2013, at 12:24 PM, John Bollinger wrote: > > > On Wednesday, August 28, 2013 5:56:45 PM UTC-5, Andy Parker wrote: > On Wed, Aug 28, 2013 at 3:22 PM, Luke Kanies wrote: > On Aug 28, 2013, at 12:38 PM, Andy Parker wrote: >> On Wed, Aug 28, 2013 at 10:20 AM, Luke Kanies wrote: >> On

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-29 Thread Luke Kanies
Sorry, I think you're over complicating this. The fix should require no changes to syntax or usage; merely the cessation of use of the anchor pattern. Containment should continue to mean what it has for years, which is generally class-to-resource and almost never class-to-class. This is easy to

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-29 Thread John Bollinger
On Wednesday, August 28, 2013 5:56:45 PM UTC-5, Andy Parker wrote: > > On Wed, Aug 28, 2013 at 3:22 PM, Luke Kanies > > > wrote: > >> On Aug 28, 2013, at 12:38 PM, Andy Parker >> > >> wrote: >> >> On Wed, Aug 28, 2013 at 10:20 AM, Luke Kanies >> >> > wrote: >> >>> On Aug 28, 2013, at 8:45

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-28 Thread Andy Parker
I just reread your email and realized that I said "no", but my final paragraph is the real response to exactly what you asked. :) So yes, adding the relationship can cause the order to change. On Wed, Aug 28, 2013 at 3:56 PM, Andy Parker wrote: > On Wed, Aug 28, 2013 at 3:22 PM, Luke Kanies w

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-28 Thread Andy Parker
On Wed, Aug 28, 2013 at 3:22 PM, Luke Kanies wrote: > On Aug 28, 2013, at 12:38 PM, Andy Parker wrote: > > On Wed, Aug 28, 2013 at 10:20 AM, Luke Kanies wrote: > >> On Aug 28, 2013, at 8:45 AM, Andy Parker wrote: >> >> > * #8040 - anchor pattern. I think a solution is in sight, but it >> did

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-28 Thread Luke Kanies
On Aug 28, 2013, at 12:38 PM, Andy Parker wrote: > On Wed, Aug 28, 2013 at 10:20 AM, Luke Kanies wrote: > On Aug 28, 2013, at 8:45 AM, Andy Parker wrote: > > > * #8040 - anchor pattern. I think a solution is in sight, but it didn't > > make 3.3.0 and it is looking like it might be backwards

Re: Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-28 Thread Andy Parker
On Wed, Aug 28, 2013 at 10:20 AM, Luke Kanies wrote: > On Aug 28, 2013, at 8:45 AM, Andy Parker wrote: > > > * #8040 - anchor pattern. I think a solution is in sight, but it > didn't make 3.3.0 and it is looking like it might be backwards incompatible. > > Why would it be incompatible? > > Tha

Anchor pattern (was Re: [Puppet-dev] Puppet 4 discussions)

2013-08-28 Thread Luke Kanies
On Aug 28, 2013, at 8:45 AM, Andy Parker wrote: > * #8040 - anchor pattern. I think a solution is in sight, but it didn't > make 3.3.0 and it is looking like it might be backwards incompatible. Why would it be incompatible? That implies that we can't ship it until 4.0, which would be a trage