Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions lib/puppet/indirector/facts/facter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,22 @@ def self.setup_search_paths(request)
end
end.flatten + Puppet[:factpath].split(File::PATH_SEPARATOR)

dirs = dirs.select do |dir|
next false unless FileTest.directory?(dir)

# Even through we no longer directly load facts in the terminus,
# print out each .rb in the facts directory as module
# developers may find that information useful for debugging purposes
if Puppet::Util::Log.sendlevel?(:info)
Puppet.info _("Loading facts")
Dir.glob("#{dir}/*.rb").each do |file|
Puppet.debug { "Loading facts from #{file}" }
dirs.select! { |dir| FileTest.directory?(dir) }

# Even though we no longer directly load facts in the terminus,
# print out each .rb in the facts directory as module
# developers may find that information useful for debugging purposes
unless dirs.empty?
Puppet.info _("Loading facts")
if Puppet::Util::Log.sendlevel?(:debug)
dirs.each do |dir|
Dir.glob("#{dir}/*.rb").each do |file|
Puppet.debug { "Loading facts from #{file}" }
end
end
end

true
end

dirs << request.options[:custom_dir] if request.options[:custom_dir]
Puppet.runtime[:facter].search(*dirs)
end
Expand Down