Issue #4242 has been updated by Peter Meier.

well in the end your script does the same and you should refactor it to 
something like:

<pre>
class system_raid::hardware {
    if $raidtype =~ /^mpt$/ {
        include system_raid::hardware::mpt
    } else {
        include system_raid::hardware::base
    }
}

class system_raid::hardware::base {
    file { "/usr/local/sbin/hwraid_monitor.py":
        source      => "puppet:///modules/system_raid/hwraid_monitor.py",
        mode        => 744,
    }
}

class system_raid::hardware::mpt inherits system_raid::hardware::base {
    package { "mpt-status":
        ensure      => present,
        category    => "sys-block",
    }
    File["/usr/local/sbin/hwraid_monitor.py"] {
        require     +> Package["mpt-status"]
    }
}
</pre>

This will fix your problem and makes your class hierarchy even much cleaner.
----------------------------------------
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.0
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