summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-12 22:58:57 -0600
committerLuke Kanies <luke@madstop.com>2009-02-12 22:58:57 -0600
commit39a8b28690377339d4c430ebf62cec5ef0ed34b8 (patch)
tree6a55de1b849f508033b812a74c9d3330bcb68e5e /lib/puppet
parent7cf085c9ebdb1d1c92e317a406844bfc0eceafe6 (diff)
downloadpuppet-39a8b28690377339d4c430ebf62cec5ef0ed34b8.tar.gz
puppet-39a8b28690377339d4c430ebf62cec5ef0ed34b8.tar.xz
puppet-39a8b28690377339d4c430ebf62cec5ef0ed34b8.zip
Fixing #1964 - Facts get loaded from plugins
Applying slightly modified patch. Also added tests. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/indirector/facts/facter.rb8
1 files changed, 6 insertions, 2 deletions
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