From 47318a009c50f2625bd3df8a1de78d5477d35b57 Mon Sep 17 00:00:00 2001 From: Ken Barber Date: Tue, 24 Jul 2012 20:29:54 +0100 Subject: [PATCH] (#10322) Insert order hash included chains from different tables 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index d8538ed..34a17e6 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -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. -- 2.45.2