From: Anastasis Andronidis Date: Thu, 26 Jul 2012 12:24:21 +0000 (+0200) Subject: (#15702) firewall duplicated rules are not removed X-Git-Tag: 0.3.0~4^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=49a677095ce557569a4f54984ac6285256a2c38a;p=puppet-modules%2Fpuppetlabs-firewall.git (#15702) firewall duplicated rules are not removed This fix makes sure that every rule has a different name so same rules get deleted. --- diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index edc7a53..03da454 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -232,7 +232,7 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir # Puppet-firewall requires that all rules have comments (resource names) and will fail if # a rule in iptables does not have a comment. We get around this by appending a high level if ! hash[:name] - hash[:name] = "9999 #{Digest::MD5.hexdigest(line)}" + hash[:name] = "999#{counter} #{Digest::MD5.hexdigest(line)}" end # Iptables defaults to log_level '4', so it is omitted from the output of iptables-save.