Issue #4771 has been updated by Paul Berry.

Assignee set to Paul Berry
Affected version changed from 2.6.1 to 2.6.0

Reproduced this bug, and verified that it did not occur in 0.25.x.

The problem occurs when, in the process of importing a file with a given name 
(call it "x.pp"), we import another file in a different directory, and that 
file tries to import a file called from its directory "x.pp".  Normally, Puppet 
is smart enough to realize that two files with the same name are different if 
they come from different directories, however there is special thread-safety 
logic in the import_if_possible() method that gets invoked in the case of 
recursive imports, and it isn't this smart.

Here's a smaller example that shows the bug:

a.pp:
<pre>
import 'b.pp'
</pre>

b.pp:
<pre>
notice('in b.pp')
import 'c/d.pp'
</pre>

c/d.pp:
<pre>
import 'b.pp'
</pre>

c/b.pp:
<pre>
notice('in c/b.pp')
</pre>

Correct behavior (from 0.25.x):
<pre>
notice: Scope(Class[main]): in c/b.pp
notice: Scope(Class[main]): in b.pp
</pre>

Buggy behavior (from 2.6.x):
<pre>
notice: Scope(Class[main]): in b.pp
</pre>

I'll work on this.
----------------------------------------
Bug #4771: import of manifests with the same name only happens once
http://projects.puppetlabs.com/issues/4771

Author: Ben -
Status: Accepted
Priority: Normal
Assignee: Paul Berry
Category: plumbing
Target version: 2.6.2
Affected version: 2.6.0
Keywords: 
Branch: 


After upgrading from 0.25.5 to 2.6.1 I found my apache modules class was 
missing.  

Looking at the master debug output the apache/modules.pp never gets imported.  
Renaming apache/modules.pp to apache/apache-modules.pp works around the problem.

file structure:
    |-- manifests
    |   |-- defaults.pp
    |   |-- modules.pp
    |   |-- site.pp
    |   |-- nodes
    |   `-- node-defaults
    `-- modules
        |-- apache
            |-- files
            |-- lib
            |   |-- facter
            |   `-- puppet
            |-- manifests
            |   |-- modules.pp
            |   |-- awstats.pp
            |   |-- defines
            |   |   |-- empty.pp
            |   |   |-- module.pp
            |   |   `-- vhost.pp
            |   `-- init.pp
            `-- templates

site.pp:
    import "defaults.pp"
    import "modules.pp"
    import "node-defaults/*.pp"
    import "nodes/*.pp"

modules.pp:
    import "apache"

apache/init.pp:
    import "defines/*.pp"
    import "modules.pp"
    import "awstats.pp"
    class apache {}


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