Skip to content
Snippets Groups Projects
Unverified Commit fbf353c0 authored by david22swan's avatar david22swan Committed by GitHub
Browse files

Merge pull request #544 from puppetlabs/gh-543-fix_networking_facts_merge

(GH-543) - Fix merging of nested default facts
parents 748bd607 e0864fb8
No related branches found
No related tags found
No related merge requests found
...@@ -509,6 +509,8 @@ Gemfile: ...@@ -509,6 +509,8 @@ Gemfile:
- gem: racc - gem: racc
version: '~> 1.4.0' version: '~> 1.4.0'
condition: "Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))" condition: "Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))"
- gem: deep_merge
version: '~> 1.0'
- gem: 'voxpupuli-puppet-lint-plugins' - gem: 'voxpupuli-puppet-lint-plugins'
version: '~> 5.0' version: '~> 5.0'
- gem: 'facterdb' - gem: 'facterdb'
...@@ -516,7 +518,7 @@ Gemfile: ...@@ -516,7 +518,7 @@ Gemfile:
- gem: 'metadata-json-lint' - gem: 'metadata-json-lint'
version: '~> 4.0' version: '~> 4.0'
- gem: 'rspec-puppet-facts' - gem: 'rspec-puppet-facts'
version: '~> 2.0' version: '~> 3.0'
- gem: 'dependency_checker' - gem: 'dependency_checker'
version: '~> 1.0.0' version: '~> 1.0.0'
- gem: 'parallel_tests' - gem: 'parallel_tests'
......
...@@ -27,7 +27,8 @@ default_fact_files.each do |f| ...@@ -27,7 +27,8 @@ default_fact_files.each do |f|
next unless File.exist?(f) && File.readable?(f) && File.size?(f) next unless File.exist?(f) && File.readable?(f) && File.size?(f)
begin begin
default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) require 'deep_merge'
default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
rescue StandardError => e rescue StandardError => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end end
...@@ -35,7 +36,7 @@ end ...@@ -35,7 +36,7 @@ end
# read default_facts and merge them over what is provided by facterdb # read default_facts and merge them over what is provided by facterdb
default_facts.each do |fact, value| default_facts.each do |fact, value|
add_custom_fact fact, value add_custom_fact fact, value, merge_facts: true
end end
RSpec.configure do |c| RSpec.configure do |c|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment