summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/indirector/facts/facter.rb4
-rwxr-xr-xspec/unit/indirector/facts/facter_spec.rb1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb
index 75c6529ca..9d181706c 100644
--- a/lib/puppet/indirector/facts/facter.rb
+++ b/lib/puppet/indirector/facts/facter.rb
@@ -10,7 +10,9 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
def self.load_fact_plugins
# Add any per-module fact directories to the factpath
module_fact_dirs = Puppet[:modulepath].split(":").collect do |d|
- Dir.glob("%s/*/lib/facter" % d)
+ ["lib", "plugins"].map do |subdirectory|
+ Dir.glob("%s/*/#{subdirectory}/facter" % d)
+ end
end.flatten
dirs = module_fact_dirs + Puppet[:factpath].split(":")
x = dirs.each do |dir|
diff --git a/spec/unit/indirector/facts/facter_spec.rb b/spec/unit/indirector/facts/facter_spec.rb
index a6dd8868d..8f39badb1 100755
--- a/spec/unit/indirector/facts/facter_spec.rb
+++ b/spec/unit/indirector/facts/facter_spec.rb
@@ -128,6 +128,7 @@ describe Puppet::Node::Facts::Facter do
Puppet.settings.expects(:value).with(:modulepath).returns("one%stwo" % File::PATH_SEPARATOR)
+ Dir.stubs(:glob).returns []
Dir.expects(:glob).with("one/*/lib/facter").returns %w{oneA oneB}
Dir.expects(:glob).with("two/*/lib/facter").returns %w{twoA twoB}