]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(#10322) Insert order hash included chains from different tables
authorKen Barber <ken@bob.sh>
Tue, 24 Jul 2012 19:29:54 +0000 (20:29 +0100)
committerKen Barber <ken@bob.sh>
Tue, 24 Jul 2012 19:29:54 +0000 (20:29 +0100)
This fix corrects the insert_order handling to make sure that not only are
rules from the same chain evaulated, but we also check that the table
matches as well.

lib/puppet/provider/firewall/iptables.rb

index d8538edd9ed8cc803caf19fa1d6e0346f09fba3f..34a17e612a663443a8c0ee23977cd922363dcaa0 100644 (file)
@@ -288,9 +288,11 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
     debug("[insert_order]")
     rules = []
 
-    # Find list of current rules based on chain
+    # Find list of current rules based on chain and table
     self.class.instances.each do |rule|
-      rules << rule.name if rule.chain == resource[:chain].to_s
+      if rule.chain == resource[:chain].to_s and rule.table == resource[:table].to_s
+        rules << rule.name
+      end
     end
 
     # No rules at all? Just bail now.