Issue #12172 has been reported by Matt Robinson.

----------------------------------------
Bug #12172: Facts in modules later in the module path should not take 
precedence over the same facts earlier in the modulepath
https://projects.puppetlabs.com/issues/12172

Author: Matt Robinson
Status: Accepted
Priority: Normal
Assignee: 
Category: facter
Target version: Telly
Affected Puppet version: 
Keywords: 
Branch: 


If your modulepath="/modules/dir1:/modules/dir2", then having the same fact in 
both dir1 and dir2 you would expect that the fact definition in dir1 would be 
the one used.  However, the fact in dir2 is currently used since the 
load_fact_plugins method in lib/puppet/indirector/facts/facter.rb walks the 
modulepath in order and calls `load` on each file.

In general you shouldn't have the same fact declared in multiple directories of 
your modulepath, which is why I imagine nobody has reported this as a bug.  
However, the behavior of other things that can go in a module (custom types and 
providers, manifests) have the behavior that the first occurrence in the 
modulepath wins.  It would be nice to have facts behavior be consistent with 
this.

However, as I write this I just realized that pluginsync also syncs the later 
module data (and does so for types and providers as well), so the current 
behavior for facts is actually more consistent that way.

I know there's a plan to not have load_facts even look at the modulepath, so 
this may be a non-issue for facts, but autloading order is probably still an 
issue.

I'll write another ticket for the autoloading order issue if one does exist and 
make that a blocker for this ticket.



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