Issue #18109 has been updated by Daniele Sluijters.

I just got bitten by this feature. We have a bunch of profiles which configure 
classes of the same name. So profile::apt configures the apt module, something 
along these lines:

<code>
class profile::apt {
  class { 'apt': }
}
</code>



----------------------------------------
Bug #18109: Class namespace declaration appears to be dynamically scoped
https://projects.puppetlabs.com/issues/18109#change-89439

* Author: Chris Spence
* Status: Needs More Information
* Priority: Normal
* Assignee: eric sorenson
* Category: 
* Target version: 
* Affected Puppet version: 2.7.19
* Keywords: 
* Branch: 
----------------------------------------
In the example below, the class declaration test generates an error

    class role::test {
      class { 'test': }
      #include test
    }
    Duplicate declaration: Class[Role::Test] is already declared; cannot 
redeclare at /etc/puppetlabs/puppet/modules/role/manifests/test.pp:2

as it appears to be attempting to redeclare itself due to dynamic namespacing 
in the class { 'test': } declaration.

the 'include test' line also doesn't do the 'right thing' because it declares 
the role::test class, however include ::test does the right thing 

The workaround is to declare class { '::test': } (or include ::test) , however 
I wouldn't expect class declaration lookup to be dynamic as a default - I can 
see that dynamic lookup would cause this to happen, but  wonder if this 
behaviour should be reviewed.


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