Issue #11451 has been updated by Nick Fagerlund.

Status changed from Accepted to In Topic Branch Pending Review

Inaccurate error messages in the code, awesome. Sure, I can do that. Pull 
request here: <https://github.com/puppetlabs/puppet/pull/300>

I don't think duplicate class definitions are... _endorsed,_ precisely? I'm not 
going to recommend it in the language guide without talking it over with some 
people, that's for sure. But I've clarified the section referenced above, since 
it looks like it lost some of its surrounding context at some point and no 
longer made much sense.
----------------------------------------
Bug #11451: multiple definitions of class allowed; multiple declarations gives 
misleading error
https://projects.puppetlabs.com/issues/11451

Author: Christian Warden
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: Nick Fagerlund
Category: documentation
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


A class can be defined multiple times, but when a class is declared multiple 
times, the error is "Duplicate definition".
    class test {
      file { '/tmp/test1.txt': content => 'test1'}
    }

    class test {
      file { '/tmp/test2.txt': content => 'test2'}
    }

    class { 'test': }
    class { 'test': }

This results in an error of
    Duplicate definition: Class[Test] is already defined in file /tmp/test.pp 
at line 9; cannot redefine at /tmp/test.pp:10 on node example.com


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