Issue #4270 has been updated by Jeff McCune.

Diving into this, I traced the debug message to the 
Puppet::Parser::TypeLoader#parse_file method.

Using ruby-debug, it appears there are two instances of 
Puppet::Parser::TypeLoader being created.  The first instance is passed a 
correct environment object instance set to "dev", however the second instance 
does not have the correct environment object instance passed in and remains set 
to "production"

This can be seen in the Puppet::Parser::TypeLoader#initialize method.

My debugging efforts are online at:
http://github.com/jeffmccune/puppet/tree/tickets/4270

(Branch tickets/4270 of remote http://github.com/jeffmccune/puppet) 
----------------------------------------
Bug #4270: Class inherit not auto-importing parent classes
http://projects.puppetlabs.com/issues/4270

Author: Dan Carley
Status: Accepted
Priority: Normal
Assigned to: 
Category: 
Target version: 2.6.0
Affected version: 2.6.0rc3
Keywords: 
Branch: 


Under 0.25, `class <class1> inherits <class2>` would auto-import a given class, 
much like `include` behaves. This no longer appears to work under 2.6.0 [rc3].

Given a simple node and module setup of:
<pre>
geppetto dev # cat manifests/nodes/pinocchio.office.xxx.com.pp
node 'pinocchio.office.xxx.com' {
    include test::one
}
geppetto dev # cat modules/test/manifests/init.pp
geppetto dev # cat modules/test/manifests/one.pp
class test::one inherits test::two {
    notice("test::one")
}
geppetto dev # cat modules/test/manifests/two.pp
class test::two {
    notice("test::two")
}
</pre>

Output from 0.25 master:
<pre>
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/init.pp'
info: Autoloaded module test
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/one.pp'
info: Autoloaded file test/one from module test
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/init.pp'
info: Autoloaded module test
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/two.pp'
info: Autoloaded file test/two from module test
notice: Scope(Class[test::two]): test::two
notice: Scope(Class[test::one]): test::one
debug: Class 'test::two' already evaluated; not evaluating again
notice: Compiled catalog for pinocchio.office.xxx.com in 0.97 seconds
</pre>

Output from 2.6 master:
<pre>
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/init.pp' in 
environment dev
debug: importing 
'/var/lib/puppet/environments/dev/modules/test/manifests/one.pp' in environment 
dev
info: Automatically imported test::one from test/one
err: Could not find parent resource type 'test::two' of type hostclass at 
/var/lib/puppet/environments/dev/modules/test/manifests/one.pp:1 on node 
pinocchio.office.xxx.com
err: Could not find parent resource type 'test::two' of type hostclass at 
/var/lib/puppet/environments/dev/modules/test/manifests/one.pp:1 on node 
pinocchio.office.xxx.com
</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