From 39a8b28690377339d4c430ebf62cec5ef0ed34b8 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 12 Feb 2009 22:58:57 -0600 Subject: Fixing #1964 - Facts get loaded from plugins Applying slightly modified patch. Also added tests. Signed-off-by: Luke Kanies --- lib/puppet/indirector/facts/facter.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb index 6ed89dac1..a026dfe60 100644 --- a/lib/puppet/indirector/facts/facter.rb +++ b/lib/puppet/indirector/facts/facter.rb @@ -24,8 +24,12 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code end def self.loadfacts - # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] - x = Puppet[:factpath].split(":").each do |dir| + # Add any per-module fact directories to the factpath + module_fact_dirs = Puppet[:modulepath].split(":").collect do |d| + Dir.glob("%s/*/plugins/facter" % d) + end.flatten + dirs = module_fact_dirs + Puppet[:factpath].split(":") + x = dirs.each do |dir| loaddir(dir, "fact") end end -- cgit