]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(maint) Fix for negated physdev_is_*
authordavid22swan <david.swan@puppet.com>
Wed, 28 Sep 2022 10:20:40 +0000 (11:20 +0100)
committerdavid22swan <david.swan@puppet.com>
Wed, 28 Sep 2022 10:20:40 +0000 (11:20 +0100)
Why confirming that this fix worked as intended it was shown that in fixing the original issue a second one had been uncovered.
This should fix the second one without infringing on the first fix.

lib/puppet/provider/firewall/iptables.rb

index 65265f1f5b64d22ee3c30a6b7cd27970df10084c..1458e75043459866eec2fb24ee61246465ccbeb3 100644 (file)
@@ -551,7 +551,7 @@ Puppet::Type.type(:firewall).provide :iptables, parent: Puppet::Provider::Firewa
                  values.sub(%r{'#{resource_map[bool]} "! "'}, "#{resource_map[bool]} true")
                else
                  # append `true` to booleans that are not already negated (followed by "!")
-                 values.sub(%r{#{resource_map[bool]}(?=\s|$)(?!"!")}, "#{resource_map[bool]} true")
+                 values.sub(%r{#{resource_map[bool]}(?=\s|$)(?!\s?"!")}, "#{resource_map[bool]} true")
                end
     end