From: Joe Julian Date: Fri, 31 May 2013 01:59:23 +0000 (-0700) Subject: Fixed dumb logic error X-Git-Tag: 0.3.1~4^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=116cf1dade2b4637967ce361c2d34fc02b0cd580;p=puppet-modules%2Fpuppetlabs-firewall.git Fixed dumb logic error --- diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index 4f03371..a9855e0 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -233,13 +233,12 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir # Puppet-firewall requires that all rules have comments (resource names) and match this # regex and will fail if a rule in iptables does not have a comment. We get around this # by appending a high level - if not /^\d+[[:alpha:][:digit:][:punct:][:space:]]+$/ =~ hash[:name] - num = 9000 + counter - hash[:name] = "#{num} #{/([[:alpha:][:digit:][:punct:][:space:]]+)/.match(hash[:name])[1]}" - end if ! hash[:name] num = 9000 + counter hash[:name] = "#{num} #{Digest::MD5.hexdigest(line)}" + elsif not /^\d+[[:alpha:][:digit:][:punct:][:space:]]+$/ =~ hash[:name] + num = 9000 + counter + hash[:name] = "#{num} #{/([[:alpha:][:digit:][:punct:][:space:]]+)/.match(hash[:name])[1]}" end # Iptables defaults to log_level '4', so it is omitted from the output of iptables-save.