Issue #2790 has been updated by Marco Eccettuato.

Luke Kanies wrote:
> This is actually behaving as designed - only one subclass can override, and 
> then if you want to append again you have to be a subclass of the appending 
> class.
> 
> Otherwise, for order-dependent values, you'd get essentially undefined 
> ordering, based on the order you evaluated the classes.
>
I was trying to use the plusignment operator to add secondary groups to an 
admin user instance from two subclasses depending on the services present on a 
server: in this case the order of evaluation wouldn't matter. But in the 
general case I can see why you chose to make it work the way you describe.

In a sense, it's also even more consistent with the single inheritance approach 
adopted (rightly, I'd say) by puppet, and it can encourage better class 
hierarchies. I'll define one of my two subclasses as a subclass of the other 
one: in my case the two services are somehow related and it makes sense.

But it's nevertheless possible to imagine a reasonable situation where you'd 
want to add values to a resource via plusignment from unrelated subclasses of a 
common class: in my case, if I wanted to allow group access for that same admin 
user to files belonging to completely unrelated services.

Are there any plans to allow this in future?


----------------------------------------
Bug #2790: "Parameter 'x' is already set" error when adding value to resource 
(plusignment)
https://projects.puppetlabs.com/issues/2790

Author: Lluis Gili
Status: Rejected
Priority: Normal
Assignee: Dan Bode
Category: language
Target version: 0.25.2
Affected Puppet version: 0.25.1
Keywords: 
Branch: 


See this manifest as example:
<pre>
class test {
  sshkey {
    "$fqdn":
      target=>"/tmp/sshkey",
      ensure=>present,
      key=>$sshrsakey,
      type=>rsa;
  }
}

class subclass1 inherits test {
  Sshkey["$fqdn"] { alias +> "subclass1" }
}

class subclass2 inherits test {
  Sshkey["$fqdn"] { alias +> "subclass2" }
}

node default {
  include subclass1
  include subclass2
}
</pre>
<pre>
puppet ~/test.pp
Parameter 'alias' is already set on Sshkey[debian.ingent.local] by subclass1 at 
/home/lluis/test.pp:12; cannot redefine at /home/lluis/test.pp:16 on node 
debian.ingent.local
</pre>

tryed with puppet 0.24.8 and 0.25.1


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to