Issue #11339 has been updated by Jeff McCune.

Status changed from Accepted to Closed

@Justin

I don't think this is a bug in Puppet.  I'm going to close this ticket, but 
please feel free to re-open if you disagree with my conclusion after reviewing 
this information and suggested fix.

If you change your init.pp manifest to be the following this problem should go 
away:

(Relationships should be specified inside the class definition, not outside.

<pre>
$ git diff
diff --git a/manifests/init.pp b/manifests/init.pp
index b8d2fa3..ae33fc1 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -10,7 +10,7 @@ class foo::three {
 
 class foo {
   include foo::one, foo::two, foo::three
+  # The notice order on the screen should be one, two three
+  Class['foo::one'] -> Class['foo::two'] -> Class['foo::three']
 }
 
-# The notice order on the screen should be one, two three
-Class['foo::one'] -> Class['foo::two'] -> Class['foo::three']
</pre>

<pre>
$ puppet apply --modulepath "${WORKSPACE}/${WORKSET}/modules" -e 'include foo'
notice: foo::one
notice: /Stage[main]/Foo::One/Notify[foo::one]/message: defined 'message' as 
'foo::one'
notice: foo::two
notice: /Stage[main]/Foo::Two/Notify[foo::two]/message: defined 'message' as 
'foo::two'
notice: foo::three
notice: /Stage[main]/Foo::Three/Notify[foo::three]/message: defined 'message' 
as 'foo::three'
notice: Finished catalog run in 0.04 seconds
</pre>

----------------------------------------
Bug #11339: Class ordering bug?
https://projects.puppetlabs.com/issues/11339#change-69307

Author: Justin Honold
Status: Closed
Priority: Normal
Assignee: 
Category: language
Target version: 2.7.x
Affected Puppet version: 2.7.9
Keywords: 
Branch: 


Using Puppet 2.7.9 on CentOS 6 with Ruby 1.8.7.

"foo" module's init.pp:

    class foo {
      include foo::one, foo::two, foo::three
    }

    Class['foo::one'] -> Class['foo::two'] -> Class['foo::three']

First I stop the Master, then start it interactively using --debug and 
--no-daemonize.  Then I apply on a client, without including the 'foo' class.

Next I tell it to include the 'foo' class.  Results:

    notice: foo::three
    notice: /Stage[main]/Foo::Three/Notify[foo::three]/message: defined 
'message' as 'foo::three'
    notice: foo::two
    notice: /Stage[main]/Foo::Two/Notify[foo::two]/message: defined 'message' 
as 'foo::two'
    notice: foo::one
    notice: /Stage[main]/Foo::One/Notify[foo::one]/message: defined 'message' 
as 'foo::one'

Three runs, then two, then one.

Here's the second run:

    notice: foo::one
    notice: /Stage[main]/Foo::One/Notify[foo::one]/message: defined 'message' 
as 'foo::one'
    notice: foo::two
    notice: /Stage[main]/Foo::Two/Notify[foo::two]/message: defined 'message' 
as 'foo::two'
    notice: foo::three
    notice: /Stage[main]/Foo::Three/Notify[foo::three]/message: defined 
'message' as 'foo::three'

One, then two, then three.  With the second run, I also see these corresponding 
entries in the Master's debug output:

    debug: Adding relationship from Class[Foo::One] to Class[Foo::Two] with 
'before'
    debug: Adding relationship from Class[Foo::Two] to Class[Foo::Three] with 
'before'

I expected this ordering to be picked up on the first run, but it only goes on 
the second and later.  Bug?  User error?


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