Issue #5517 has been updated by Henrik Lindberg.
Have a hard time seeing how this can be "fixed" in an easy way. There are
several things that confuse people; borrowing terminology from object oriented
programming like "class" and "inheritence". The inheritence mechanism in
particular is really an extension since there is no new copy being made of the
inherited class's instance variables. Thus the choice to do lazy or eager
evaluation is basically a choice between shooting yourself in the left or the
right foot.
It is basically wrong to instantiate a puppet host-class multiple times with
different parameters. Puppet should give an error in this case and not silently
ignore the issue.
Use of databinding (either via Hiera, or the new Puppet Bindings (ARM-8 and
ARM-8 "Data in Modules") helps a lot; basically because it defines strict
semantics for when evaluation takes place and how overrides work.
Trying to make it both backwards compatible, sane, and at the same time provide
a mechanism to "override" is IMHO not doable.
The best proposal so far seems to be to deprecated the syntax that instantiates
a class with parameters (i.e. the `class { name: ...}` syntax), and instead
rely on data bindings - here I would like to see data bindings declared in
puppet language as proposed in ARM-8 to make them easier to define and
understand).
----------------------------------------
Bug #5517: behavior change within 2.6 makes it impossible to override class
parameters of "included" parametrized classes
https://projects.puppetlabs.com/issues/5517#change-96375
* Author: Peter Meier
* Status: Accepted
* Priority: High
* Assignee: eric sorenson
* Category: language
* Target version: 3.x
* Affected Puppet version: 3.0.2
* Keywords: parameterized_classes
* Branch:
----------------------------------------
In 2.6.1 the following recipe:
<pre>
class a(
$b_c = { 'b' => 'foo' }
) {
notice $a::b_c
if $a::b_c {
notice $a::b_c['b']
}
}
class b {
class{'a': b_c => false }
}
class b::c inherits b {
Class['a']{ b_c => { 'b' => 'bleh' } }
}
class b::d {
include ::b::c
}
include b::d
</pre>
produces the following output:
<pre>
$ puppet foo.pp
notice: Scope(Class[A]): bbleh
notice: Scope(Class[A]): bleh
</pre>
Which is what I expected. However with 2.6.3 it produces the following output:
<pre>
# puppet foo.pp
notice: Scope(Class[A]): false
</pre>
Imho likely the changes for #4778 and #5074 are responsible for that behavior
change.
However this makes it impossible to overwrite parameters of a "included"
parametrized class in a subclass. There are only ugly workarounds for that
problem and I think this should actually work as it did within 2.6.1. Otherwise
the usefulness of parametrized classes is quite reduced.
--
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.