Skip to content

Commit

Permalink
(GH-543) - Fix merging of nested default facts
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Jan 23, 2024
1 parent fab915c commit c8cb46b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ Gemfile:
- gem: racc
version: '~> 1.4.0'
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'
version: '~> 5.0'
- gem: 'facterdb'
Expand Down
3 changes: 2 additions & 1 deletion moduleroot/spec/spec_helper.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ default_fact_files.each do |f|
next unless File.exist?(f) && File.readable?(f) && File.size?(f)

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
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end
Expand Down

0 comments on commit c8cb46b

Please sign in to comment.