Issue #5517 has been updated by Nick Lewis.
Status changed from Accepted to Investigating
So the change that broke this is eagerly evaluating parameterized classes. This
is necessary because lazily evaluating with one syntax, `class { foo: }`, and
eagerly evaluating with the other, `include foo`, causes inconsistent behavior.
Given that we eagerly evaluate parameterized classes, I can't conceive of a
model of evaluation that could cause this to work correctly. Essentially the
first thing we end up evaluating is class a, at which point we immediately
execute the notices, because they're functions. Changing the notices to notify
resources can reconcile this behavior in the presence of futures, should we
ever choose to implement those. But for notices, I can't see a way this could
ever work reasonably.
This also points to a deeper incongruence between futures (which are implicitly
lazy) and non-rvalue functions (which are implicitly eager and therefore
order-dependent).
Do you have a concrete use case for this? There may be another way to
accomplish the desired behavior, or at least to provide some mechanism to
accomplish it.
----------------------------------------
Bug #5517: behavior change within 2.6 makes it impossible to override class
parameters of "included" parametrized classes
https://projects.puppetlabs.com/issues/5517
Author: Peter Meier
Status: Investigating
Priority: High
Assignee:
Category: language
Target version: 2.6.x
Affected Puppet version: 2.6.3
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 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.