Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

(FACT-2522) Fix for tests/external_facts/fact_directory_precedence.rb #517

Merged
merged 2 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion lib/custom_facts/util/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def self.setup_default_ext_facts_dirs
Facter::Options[:default_external_dir] = if windows_dir
[File.join(windows_dir, 'PuppetLabs', 'facter', 'facts.d')]
else
['/opt/puppetlabs/facter/facts.d']
[
'/etc/puppetlabs/facter/facts.d',
'/etc/facter/facts.d/',
'/opt/puppetlabs/facter/facts.d'
]
end
elsif ENV['HOME']
Facter::Options[:default_external_dir] =
Expand Down
6 changes: 5 additions & 1 deletion spec/custom_facts/util/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
allow(LegacyFacter::Util::Config).to receive(:windows_data_dir).and_return(nil)
LegacyFacter::Util::Config.setup_default_ext_facts_dirs
expect(LegacyFacter::Util::Config.external_facts_dirs)
.to eq ['/opt/puppetlabs/facter/facts.d']
.to eq [
'/etc/puppetlabs/facter/facts.d',
'/etc/facter/facts.d/',
'/opt/puppetlabs/facter/facts.d'
]
end

it 'returns the default value for windows 2008' do
Expand Down