]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(#13192) Fix allvalidchain iteration
authorKen Barber <ken@bob.sh>
Fri, 16 Mar 2012 22:16:23 +0000 (15:16 -0700)
committerKen Barber <ken@bob.sh>
Fri, 16 Mar 2012 22:16:23 +0000 (15:16 -0700)
Before this patch, we were getting errors because chain & table were swapped
during creation.

lib/puppet/provider/firewallchain/iptables_chain.rb

index 758d37c49fbc2596014b3939ece81642e60a84d6..0efb55d4bb4768b2a6b198a49b3d1a58bd842f12 100644 (file)
@@ -61,7 +61,7 @@ Puppet::Type.type(:firewallchain).provide :iptables_chain do
     if @resource[:name] =~ InternalChains
       self.warn "Attempting to destroy internal chain #{@resource[:name]}"
     end
-    allvalidchains do |t, table, chain|
+    allvalidchains do |t, chain, table|
       debug "Deleting chain #{chain} on table #{table}"
       t.call ['-t',table,'-X',chain]
     end
@@ -73,7 +73,7 @@ Puppet::Type.type(:firewallchain).provide :iptables_chain do
 
   def policy=(value)
     return if value == :empty
-    allvalidchains do |t, table, chain|
+    allvalidchains do |t, chain, table|
       p = ['-t',table,'-P',chain,value.to_s.upcase]
       debug "[set policy] #{t} #{p}"
       t.call p