Issue #10848 has been updated by Lars Kellogg-Stedman.
So maybe this is a documentation bug? I've been through the documentation at http://docs.puppetlabs.com/guides/language_guide.html several times, and there's nothing there to indicate that including classes via "class {}" is any different from using "include". Maybe a note in the "Parameterised Classes" section? E.g: While the `class {}` syntax with no parameters is largely equivalent to `include`, name resolution will start in the local scope rather than the local scope. In other words, `class { ::foo: }` is equivalent to `include foo`. ---------------------------------------- Bug #10848: When is "class { foo: }" not equivalent to "include foo"? https://projects.puppetlabs.com/issues/10848 Author: Lars Kellogg-Stedman Status: Accepted Priority: Normal Assignee: Category: plumbing Target version: Affected Puppet version: 2.6.0 Keywords: Branch: If I have: modules/ autofs/ manifests/ init.pp virtcluster/ manifests/ autofs.pp And in autofs/manifests/init.pp I have: class autofs { } And in virtcluster/manifests/autofs.pp I have: class virtcluster::autofs { include autofs } This works as intended. However, if I replace `include` with a new-style class directive: class virtcluster::autofs { class { autofs: } } This fails with a "duplicate definition" error: Duplicate definition: Class[Virtcluster::Autofs] is already defined; cannot redefined at ... Is this expected? I thought that `class { foo: }` was supposed to be equivalent to `include foo`, but obviously the semantics are different. I'm using 2.7.6 right now, but I've seen this with earlier versions as well. -- 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.
