From c30a3d694cba2c05002198747918d3747d5c261b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 24 May 2024 22:05:06 +0200 Subject: [PATCH] stringify facts, if required, before collecting custom facts This is the result of some poking in https://github.com/voxpupuli/voxpupuli-test/pull/131 and https://github.com/voxpupuli/voxpupuli-test/pull/132#issuecomment-2130110078 Tested in: https://github.com/voxpupuli/puppet-example/pull/54 --- lib/rspec-puppet-facts.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rspec-puppet-facts.rb b/lib/rspec-puppet-facts.rb index 0f5f0cd7..dd986274 100644 --- a/lib/rspec-puppet-facts.rb +++ b/lib/rspec-puppet-facts.rb @@ -170,11 +170,10 @@ def on_supported_os_implementation(opts = {}) os = "#{facts[:operatingsystem].downcase}-#{operatingsystemmajrelease}-#{facts[:hardwaremodel]}" next unless os.start_with? RspecPuppetFacts.spec_facts_os_filter if RspecPuppetFacts.spec_facts_os_filter facts.merge! RspecPuppetFacts.common_facts + facts = stringify_keys(facts) if RSpec.configuration.facterdb_string_keys os_facts_hash[os] = RspecPuppetFacts.with_custom_facts(os, facts) end - return stringify_keys(os_facts_hash) if RSpec.configuration.facterdb_string_keys - os_facts_hash end