Issue #6019 has been updated by Nigel Kersten.

Status changed from Needs Decision to Accepted
Assignee deleted (Nigel Kersten)
Target version set to Statler

It seems sanest to me that an inherited class should also inherit the stage 
from the parent by default, but you should be able to override it if you desire.
----------------------------------------
Bug #6019: Subclasses don't inherit run stage correctly?
https://projects.puppetlabs.com/issues/6019

Author: Roald van Loon
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: Statler
Affected Puppet version: 
Keywords: 
Branch: 


Hi,

Seems like subclasses are not automatically placed in the correct run stage, 
when they inherit the stage from a parent.

Consider the following small test manifest;

    stage { second: require => Stage[main] }
    notify { "test": }
    class testsuper {
    
    }
    
    class testsuper::testsub inherits testsuper {
        notify { "this is testsuper::testsub, and my stage is $stage":
            require => Notify["test"]
        }
    }

    class { "testsuper": stage => second }

    node test {
        include testsuper::testsub
    }

This results in the following;

    <snip>
    debug: /Stage[second]/require: requires Stage[main]
    debug: /Stage[main]/Testsuper::Testsub/Notify[this is testsuper::testsub, 
and my stage is second]/require: requires Notify[test]
    <snip>


So apparently, the $stage metaparameter in "testsuper::testsub" is set to 
"second" correctly, but the puppet run still indicates that the notify should 
take place in stage "main".

Looks to me like this is unwanted behavior?

If I change this ...

    class { "testsuper": stage => second }

... into this;

    class { "testsuper::testsub": stage => second }


... then the "testsub" subclass is executed in the correct stage;

    <snip>
    debug: /Stage[second]/require: requires Stage[main]
    debug: /Stage[second]/Testsuper::Testsub/Notify[this is testsuper::testsub, 
and my stage is second]/require: requires Notify[test]
    <snip>


But I assume it's not by design that I have to apply the stage to every 
subclass.



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