Issue #4248 has been updated by Josh Cooper.

Keywords set to autoloader

Andrew  Parker wrote:
> The mount_providers module has a file `lib/puppet/provider/mountpoint.rb` 
> that is loaded with `require` from `lib/puppet/provider/mountpoint/linux.rb`. 
> This fails because the `mountpoint.rb` file is nowhere to be found in the 
> load path.

If the autoloader loads module A, and A requires module B, and both modules 
change, e.g. pluginsync, then the autoloader will never reload B, which will 
lead to crazy code inconsistency bugs. Fortunately, the agent forks (it will in 
3.0.2 #17361) eliminating this issue on the agent side. But it is an issue on 
the master side, e.g. an autoloaded function requires utility code.
----------------------------------------
Feature #4248: Load "library" plugins that are used by multiple puppet 
functions and delivered via pluginsync
https://projects.puppetlabs.com/issues/4248#change-76134

Author: R.I. Pienaar
Status: Accepted
Priority: Normal
Assignee: 
Category: plumbing
Target version: 2.7.x
Affected Puppet version: 0.25.5
Keywords: autoloader
Branch: 


Because we do not add all module lib directories to Ruby's search path, ruby 
classes that exist only in the modules (because they have not yet been synced 
via pluginsync) cannot be found.  The autoloader correctly loads files from the 
modules, but ruby itself can't load supporting classes.


Old description:

At present we can copy parser functions, types and providers out with plugins 
sync, this works fine.

It seems though we cannot copy out Puppet::Util::* classes - useful for code 
accessed by various parser functions for example.

I need to do something like:

<pre>
require File.dirname(__FILE__) + '/../../util/foo.rb'
</pre>

from a parser function since:

<pre>
require 'puppet/util/foo'
</pre>

doesnt work.

I am also keen to be able to copy out new application classes that will tie 
into the puppet single executable thing, i guess these 2 features might be in 
the same realm.



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