]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fix for physdev idempotency on EL5
authorJonathan Tripathy <jt@puppetlabs.com>
Thu, 25 Jun 2015 13:14:18 +0000 (14:14 +0100)
committerJonathan Tripathy <jt@puppetlabs.com>
Thu, 25 Jun 2015 13:14:18 +0000 (14:14 +0100)
lib/puppet/provider/firewall/iptables.rb

index 4bcf4c4fbd71e7c4c89aa7b3b1f4a369a95f5ad3..fcf9373d0a32f8375878c59d6e48b1541cf6e2cb 100644 (file)
@@ -329,6 +329,8 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
     values = values.gsub(/(!)\s*(-\S+)\s*(\S*)/, '\2 "\1 \3"')
     # The match extension for tcp & udp are optional and throws off the @resource_map.
     values = values.gsub(/(?!-m tcp --tcp-flags)-m (tcp|udp) /, '')
+    # There is a bug in EL5 which puts 2 spaces before physdev, so we fix it
+    values = values.gsub(/\s{2}--physdev/, ' --physdev')
     # '--pol ipsec' takes many optional arguments; we cheat again by adding " around them
     values = values.sub(/
         --pol\sipsec