From fea215e45f82b8de83acbc58fff1da251593f51c Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 13 Jul 2022 11:35:53 +0100 Subject: [PATCH] (GH-1055) Fix for `--random-fully` Issues have arisen with the --random-fully value on certain RedHat versions. It seem's as if the logic put in around `--random` and `--random-fully` are no longer working. This change should resolve the issue and tighten the logic around the `known_boolean` values. --- lib/puppet/provider/firewall/iptables.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index 9b9c301..65265f1 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -549,11 +549,9 @@ Puppet::Type.type(:firewall).provide :iptables, parent: Puppet::Provider::Firewa values.sub(%r{\s-f(?!l)(?=.*--comment)}, ' -f true') elsif resource_map[bool].eql?(%r{'--physdev-is-\S+'}) values.sub(%r{'#{resource_map[bool]} "! "'}, "#{resource_map[bool]} true") - elsif bool == :random - values.sub(%r{#{resource_map[bool]}(\s|$)(?!"!")}, "#{resource_map[bool]} true") else # append `true` to booleans that are not already negated (followed by "!") - values.sub(%r{#{resource_map[bool]}(?! "!")}, "#{resource_map[bool]} true") + values.sub(%r{#{resource_map[bool]}(?=\s|$)(?!"!")}, "#{resource_map[bool]} true") end end -- 2.45.2