Issue #21432 has been reported by Mickaël Canévet.

----------------------------------------
Bug #21432: Class declaration scope issue
https://projects.puppetlabs.com/issues/21432

* Author: Mickaël Canévet
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
Hi,

I have a strange issue in puppet 2.7(.19 and .22) that I don't have with puppet 
3(.0.0 and .2.2):

First I install puppetlabs-postgresql in a temporary directory:

 mkdir modules
 puppet module install --modulepath modules puppetlabs-postgresql

Then I test this simple code:

 puppet apply --noop --modulepath=modules/ -e "class {'::postgresql': } -> 
class {'::postgresql::server': }"

It works (at least it compiles).

Then I create a simple module:

 mkdir -p modules/my_module/manifests

with a simple class doing the same thing as above:

 cat << EOF > modules/my_module/manifests/pgsql.pp
 class my_module::pgsql {
   class {'::postgresql': } -> class {'::postgresql::server': }
 }
 EOF

When I try to apply it, it works:

 puppet apply --noop --modulepath=modules/ -e "include my_module::pgsql"

But if I create another class my_module::postgresql, it fails:

 cat << EOF > modules/my_module/manifests/postgresql.pp
 class my_module::postgresql {
   class {'::postgresql': } -> class {'::postgresql::server': }
 }
 EOF

With this error message:

 puppet apply --noop --modulepath=modules/ -e "include my_module::postgresql"
 Duplicate declaration: Class[Postgresql::Params] is already declared; cannot 
redeclare at modules/postgresql/manifests/init.pp:144

And now if I launch this:

 puppet apply --noop --modulepath=modules/ -e "include my_module::pgsql"

I get:

 Duplicate declaration: Class[Postgresql] is already declared in file 
modules/my_module/manifests/pgsql.pp at line 2; cannot redeclare at 
modules/my_module/manifests/postgresql.pp:2 on node wrk8.wrk.lsn.camptocamp.com

I think that in some case the '::' prefix before 'postgresql' is not well 
interpreted.


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to