Issue #10848 has been updated by Daniel Pittman.

Assignee deleted (Daniel Pittman)

----------------------------------------
Bug #10848: When is "class { foo: }" not equivalent to "include foo"?
https://projects.puppetlabs.com/issues/10848#change-92269

* Author: Lars Kellogg-Stedman
* Status: Duplicate
* 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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to