On Tuesday, June 26, 2012 6:14:32 AM UTC-4, Stephen Gran wrote:
>
> Hi, 
>
>
>
> On Tue, 2012-06-26 at 11:47 +0200, Felix Frank wrote: 
> > Hi, 
> > 
> > On 06/26/2012 10:56 AM, Stephen Gran wrote: 
> > > There is one difference that is most likely a bug.  try this manifest: 
> > > 
> > > ./test.pp 
> > > class { 'wobble': } 
> > > class { 'wibble': } 
> > 
> > I disagree on this being a bug. 
> > 
> > This syntax is for parameterized classes. Such classes cannot be 
> > declared more than once, because the declaration binds parameter values 
> > that cannot be sanely changed at a later point of compilation. 
> > 
> > So multiple usage of this syntax is not supported. 
> > 
> > I'd suggest avoiding it if it's not needed pass actual class parameters. 
>
> I disagree that instantiating a class twice with identical (especially 
> default) parameters should result in an error.  A class is a singleton, 
> unlike a define, so should not be indexed solely on it's name.  It 
> should be an error to try to redefine the parameters that you 
> instantiate a class with, of course. 
>
> However, I see that this is probably not a trivial change, and I don't 
> think it's that big a deal, in practice.  It does mean jumping through 
> some hoops when you have something like multiple application classes 
> using a single parameterized configuration class, but it can be lived 
> with. 
>

I think I'm good with only allowing declaring a class once with parameters 
it makes since that puppet can't make a decision on which set of parameters 
to use what with not being able to read your mind and all. :-)

I would like to be able to include a class in multiple places even if I 
have declared the class with parameters somewhere else in the catalogue. As 
it works now I can do this as long as the first place the compile sees the 
class is the declaration with parameters.  If you include a class before 
the compiler gets to the parameterized declaration you get the error 
complaining about declaring a class more than once. I sort of view an 
include as saying "I just need some stuff from that other class so I can 
reference it here and I don't really care what parameters are passed to 
it". Declaring a class with parameters is for the cases where I do need to 
be specific.

Russell

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/U5r6lEYraQAJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to