Issue #4792 has been updated by Paul Berry.

Branch set to http://github.com/stereotype441/puppet/tree/ticket/2.6.x/4792

Here's our suspicion as to what's going on:

* The external node classifier returns classes A and B
* class A happens to include class B
* evaluate_definitions determines that classes A and B need to be evaluated.
* first it evaluates class A.  Since class A includes class B, this causes 
class B to be evaluated too.
* then, evaluate_definitions tries to evaluate class B.  But since class B has 
already been evaluated, it gets evaluated again.
* consequently, any resources defined in class B get duplicated.

We've uploaded an experimental patch to 
http://github.com/stereotype441/puppet/tree/ticket/2.6.x/4792 that causes 
evaluate_definitions to check each class in turn before evaluating it, rather 
than figuring out which classes to evaluate first and then evaluating all of 
them.

Can someone please try this patch on site to see if it addresses the problem?
----------------------------------------
Bug #4792: Duplicate definition since 2.6.1 upgrade
http://projects.puppetlabs.com/issues/4792

Author: James Turnbull
Status: Needs more information
Priority: High
Assignee: Jesse Wolfe
Category: parser
Target version: 2.6.2
Affected version: 2.6.1
Keywords: 
Branch: http://github.com/stereotype441/puppet/tree/ticket/2.6.x/4792


Class, users::virtual which has all the user{} statements for all users. Then 
have classes like users::cms and users::developers that inherit users::virtual 
and then realize some of the users. This all worked perfectly fine in 2.5 but 
since 2.6.1 runs now fail with:

<pre>
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: User[apen 
ney] is already defined in file 
/etc/puppet/modules/testing/users/manifests/virtual.pp at line 19; canno 
t redefine at /etc/puppet/modules/testing/users/manifests/virtual.pp:19 on node 
hlslinutil1.law.harvard. 
edu
</pre>

<pre>
realize( 
User['user'], 
) 
}

# cat virtual.pp 
class users::virtual {

## 
## Sysadmins 
##

@user { "user": 
ensure => "present", 
uid => 35421, 
gid => 100, 
groups => "wheel", 
comment => "User Name", 
home => "/home/user", 
shell => "/bin/zsh", 
password => password, 
managehome => true, 
} 
}
</pre>


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