Issue #5044 has been updated by Nigel Kersten.

Note that this may be completely irrelevant if we enforce one class per file as 
in #5041
----------------------------------------
Feature #5044: Autoloading order improvements
https://projects.puppetlabs.com/issues/5044

Author: Paul Berry
Status: Accepted
Priority: Normal
Assignee: 
Category: language
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


This ticket captures and elaborates on a decision made on the developer mailing 
list in late September (see email thread “PL RFC-1: Semantics of autoloaded 
classes”).

When attempting to autoload a class foo::bar::baz, we currently look at files 
in the following order:

If foo is the name of a module:
<pre>
$module_path/foo/manifests/init.pp
$module_path/foo/manifests/bar/baz.pp
$module_path/foo/manifests/bar.pp
</pre>

If foo is not the name of a module:
<pre>
./foo/bar/baz.pp
./foo/bar.pp
./foo.pp
</pre>

In other words, the search is done in the order of specific to general, with 
the exception that in modules, init.pp is searched first.

This can lead to order dependencies and inconsistencies if a user accidentally 
defines classes in multiple places.  For example, if class foo::bar is defined 
in foo/bar.pp, and foo::bar::baz is defined in both foo/bar/baz.pp and 
foo/bar.pp, then if the version of foo::bar::baz that actually gets used will 
depend upon whether Puppet decided to autoload foo::bar or foo::bar::baz first.

We would like to change the order to go from general to specific:

<pre>
$module_path/foo/manifests/init.pp
$module_path/foo/manifests/bar.pp
$module_path/foo/manifests/bar/baz.pp
</pre>

and

<pre>
./foo.pp
./foo/bar.pp
./foo/bar/baz.pp
</pre>

This, combined with ticket #5041, should prevent order dependencies and 
inconsistencies from arising from autoloading.


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