Issue #4242 has been updated by Dan Carley.

I'm finding more examples of this in my manifests now that I'm able to test 2.6 
again. It seems that I've used bi-directional `inherits`/`include` a lot, to 
ensure that sub-classes can't be executed without the supporting parent 
classe[s]. Much like your `define()` example, Peter.

I figure that you could replace these with a liberal splattering of `require => 
Class["parent::class"]` to all of the types within and accept that the class 
will hard fail if used in the wrong way. But it doesn't really feel right.

Is it possible for Puppet to just stomp on the recursion after the first 
iteration? Is this how 0.25.0 behaved behind the scenes?
----------------------------------------
Bug #4242: behavior change in recursive inclusions
http://projects.puppetlabs.com/issues/4242

Author: Peter Meier
Status: Accepted
Priority: Normal
Assigned to: Matt Robinson
Category: 
Target version: 2.6.1
Affected version: 2.6.0rc3
Keywords: 
Branch: 


The following (rather weird) class setup worked on 0.25.x:

<pre>
# cat foo.pp 
class test {
  notice("test")
  file{'/tmp/a': ensure => file }
  include testa
}
class testa inherits test {
  notice("testa")
}
include test
</pre>

0.25.5:
<pre>
$ puppet foo.pp
notice: Scope(Class[test]): test
notice: Scope(Class[testa]): testa
notice: //test/File[/tmp/a]/ensure: created
</pre>

2.6:
<pre>
$ puppet foo.pp
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
Duplicate definition: File[/tmp/a] is already defined in file /tmp/foo.pp at 
line 3; cannot redefine at /tmp/foo.pp:3 on node puppet.bar.ch
</pre>

If you remove the file statement, we get the following on 2.6:

<pre>
$ puppet foo.pp
[... a lot of messages ...]
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
notice: Scope(Class[Test]): test
stack level too deep at /tmp/foo.pp:3 on node puppet.bar.ch
</pre>

I don't know if the old behavior was actually correct and the new one should be 
fixed, but I think at least the behavior change should be documented somewhere.


-- 
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