From 34592f57178e3ad858061ee309f5e62100ec72ed Mon Sep 17 00:00:00 2001 From: Nick Bertrand Date: Fri, 2 Feb 2024 13:25:47 -0600 Subject: [PATCH 1/2] Prevent sources with zero prefix length being applied every agent run --- lib/puppet/provider/firewall/firewall.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/firewall/firewall.rb b/lib/puppet/provider/firewall/firewall.rb index a5560e8bb..06b5a5aba 100644 --- a/lib/puppet/provider/firewall/firewall.rb +++ b/lib/puppet/provider/firewall/firewall.rb @@ -325,8 +325,8 @@ def delete(context, name, is) def insync?(context, _name, property_name, is_hash, should_hash) context.debug("Checking whether '#{property_name}' is out of sync") - # If either value is nil, no custom logic is required - return nil if is_hash[property_name].nil? || should_hash[property_name].nil? + # If either value is nil, no custom logic is required unless property is source or destination + return nil if (is_hash[property_name].nil? || should_hash[property_name].nil?) && ! [:source, :destination].include?(property_name) case property_name when :protocol From 7d64674ca4a603676ea8990acede98119c04a9dd Mon Sep 17 00:00:00 2001 From: Nick Bertrand Date: Mon, 25 Nov 2024 09:55:17 -0600 Subject: [PATCH 2/2] Fix rubocop warning --- lib/puppet/provider/firewall/firewall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/firewall/firewall.rb b/lib/puppet/provider/firewall/firewall.rb index 584da2e45..b064c9f8a 100644 --- a/lib/puppet/provider/firewall/firewall.rb +++ b/lib/puppet/provider/firewall/firewall.rb @@ -326,7 +326,7 @@ def insync?(context, _name, property_name, is_hash, should_hash) context.debug("Checking whether '#{property_name}' is out of sync") # If either value is nil, no custom logic is required unless property is source or destination - return nil if (is_hash[property_name].nil? || should_hash[property_name].nil?) && ! [:source, :destination].include?(property_name) + return nil if (is_hash[property_name].nil? || should_hash[property_name].nil?) && ![:source, :destination].include?(property_name) case property_name when :protocol