From 5bcc857625e70c1467c47ec7ba12b2be81c21e6b Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Wed, 6 Sep 2023 08:47:40 -0500 Subject: [PATCH] Updates for Puppet 8 (#164) * Fixes for Ruby 3 * Add explicit support for Puppet 8 * Drop support for Puppet 6 * Add support for stdlib 9 Fixes #163 --- CHANGELOG | 7 +++++++ lib/puppetx/simp/compliance_map.rb | 2 +- metadata.json | 6 +++--- spec/classes/init_spec.rb | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e426184..3eebc90 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +* Tue Sep 05 2023 Steven Pritchard - 3.6.0 +- Updates for Puppet 8 + - Fixes for Ruby 3 + - Add explicit support for Puppet 8 +- Drop support for Puppet 6 +- Add support for stdlib 9 + * Wed Aug 23 2023 Steven Pritchard - 3.5.0 - Add AlmaLinux 8 support diff --git a/lib/puppetx/simp/compliance_map.rb b/lib/puppetx/simp/compliance_map.rb index 537c9ce..8a6bcd3 100644 --- a/lib/puppetx/simp/compliance_map.rb +++ b/lib/puppetx/simp/compliance_map.rb @@ -327,7 +327,7 @@ def compliance_map(args, context) end classkey = "#{res.type}[#{res.title}]" - if expected_value =~ /^re:(.+)/ + if expected_value.is_a?(String) && expected_value =~ /^re:(.+)/ section = (current_value =~ Regexp.new($1)) ? 'compliant' : 'non_compliant' else section = (current_value == expected_value) ? 'compliant' : 'non_compliant' diff --git a/metadata.json b/metadata.json index 5b69381..3340c0e 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-compliance_markup", - "version": "3.5.0", + "version": "3.6.0", "author": "SIMP Team", "summary": "Compliance-mapping annotation for Puppet code", "license": "Apache-2.0", @@ -16,7 +16,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 8.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 10.0.0" }, { "name": "simp/simplib", @@ -67,7 +67,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.22.1 < 8.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ] } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index de59c2b..84f9157 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -60,7 +60,7 @@ def remove_data } let(:report) { - @report = YAML.load(raw_report) + @report = YAML.safe_load(raw_report, aliases: true) @report }