The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #6019

Subclasses don't inherit run stage correctly?

Added by Roald van Loon over 3 years ago. Updated over 1 year ago.

Status:DuplicateStart date:01/26/2011
Priority:NormalDue date:
Assignee:Charlie Sharpsteen% Done:

0%

Category:-
Target version:-
Affected Puppet version: Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

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.


Related issues

Duplicates Puppet - Bug #5349: Class inheritance and stages act weirdly Accepted 11/18/2010

History

#1 Updated by Ben Hughes over 3 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

Thank you for reporting this.

Either this is the desired behaviour and we really need to document it, or it isn’t and we need to fix it. Nigel?

#2 Updated by Nigel Kersten over 3 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Nigel Kersten)
  • Target version set to 2.7.x

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.

#3 Updated by Andrew Parker over 1 year ago

  • Target version deleted (2.7.x)

#4 Updated by Andrew Parker over 1 year ago

As the 2.7.x line is winding down, I am removing the target at 2.7.x from tickets in the system. The 2.7 line should only receive fixes for major problems (crashes, for instance) or security problems.

#5 Updated by Charlie Sharpsteen over 1 year ago

  • Status changed from Accepted to Duplicate
  • Assignee set to Charlie Sharpsteen

Closing as a duplicate of #5349.

Also available in: Atom PDF