Issue #13948 has been reported by Chris Price.

----------------------------------------
Bug #13948: libdir does not always get added to LOAD_PATH
https://projects.puppetlabs.com/issues/13948

Author: Chris Price
Status: Accepted
Priority: Urgent
Assignee: Chris Price
Category: Faces
Target version: Telly
Affected Puppet version: 
Keywords: apps faces pluginsync
Branch: 


There is a hook for the libdir setting that causes it to be added to the ruby 
LOAD_PATH whenever a value is assigned to it.  Without this hook being 
triggered, puppet won't be able to locate faces and applications correctly.

This is problematic if the user's configuration leaves libdir set to its 
default value of "$vardir/lib"; in this case it never gets explicitly assigned, 
and thus the hook will never be called.

This worked OK in 2.7.x because the libdir setting used ":call_on_define", 
which meant that the hook would always get called at the time that the setting 
was defined.  However, in Telly, certain settings (including libdir) MUST not 
be initialized at definition time--doing so introduces very confusing and 
problematic ordering issues whereby you have to be very careful about what 
point in the application lifecycle you are able to call "require 'puppet'".  
Therefore, we no longer use :call_on_define for libdir.

To repro this, just pluginsync or copy a module that contains an app or face 
into your local $vardir/lib, and then run 'puppet help' without explicitly 
specifying 'libdir'.  Your app/face will not show up in the help list.

Possible fixes:

1) There is a spot in the code (probably in Settings#set_value or something 
called from in there) that will detect that we don't currently have a cached, 
interpolated value for a setting.  We could probably check for and trigger the 
hook at that point in time.

2) Much less desirable, hacky... but would work as a last resort: we could put 
a line at the end of "Settings#initialize_app_defaults" that explicitly calls 
the hook for libdir.



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