Issue #11412 has been updated by Daniel Pittman. Category set to class inheritance Status changed from Unreviewed to Accepted
Thanks. We have ... some issues around inheritance. This looks to be another of them; we generally recommend you don't use it, because it doesn't work the way it looks like it should. We hope to rehabilitate it at some point, but that isn't going to be in the 2.7 series, because it is a "breaking" change; it probably isn't on the cards for the next major release at this point, but it is absolutely on our list of things we want to fix. ---------------------------------------- Bug #11412: Addidtional inherited classes loaded by an external node script don't overwrite parameters correctly https://projects.puppetlabs.com/issues/11412 Author: Andreas Zuber Status: Accepted Priority: Normal Assignee: Category: class inheritance Target version: Affected Puppet version: 2.7.6 Keywords: Branch: This is the code to reproduce the bug: **foo.pp** <pre> define speak ($say) { notice("$say") } class foo { speak{'one': say => "screwed up" } } class foo::bar inherits foo { Speak['one']{ say => "hello"} speak{'two': say => "world"} } node 'default' { include foo } </pre> **foo_node.sh** <pre> #!/bin/sh echo -e "classes: [\"foo::bar\"]\nparameters: {}\n" </pre> The expected output is of course a notice "hello" followed by a notice "world". But what actually happens is this: <pre> $ puppet apply --node_terminus=exec --external_nodes=$HOME/tmp/foo_node.sh foo.pp notice: Scope(Speak[one]): screwed up notice: Scope(Speak[two]): world notice: Finished catalog run in 0.04 seconds </pre> As you can see puppet loads the class "foo::bar" otherwise there would be no "world" in the output. But it does not modify the inherited resource "Speak[one]". If I include "foo::bar" from the default node <pre> node 'default' { include foo include foo::bar } </pre> then I get the expected result: <pre> $ puppet apply foo.pp notice: Scope(Speak[one]): hello notice: Scope(Speak[two]): world notice: Finished catalog run in 0.04 seconds </pre> This was tested with the puppet versions 2.7.6 as well as 2.6.4 -- 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.
