]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
MODULES-8413 fix delete chains which is INTERNAL_CHAINS
authorlionce <loredana.ionce@puppet.com>
Thu, 14 Nov 2019 15:08:21 +0000 (17:08 +0200)
committerlionce <loredana.ionce@puppet.com>
Thu, 14 Nov 2019 15:08:21 +0000 (17:08 +0200)
lib/puppet/provider/firewallchain/iptables_chain.rb

index 5bc03c34714b6b0e5e8ffb109c51d500f0acf144..6182283cb19fc11fa24f300a761342f4e5dd9ae0 100644 (file)
@@ -62,9 +62,10 @@ Puppet::Type.type(:firewallchain).provide :iptables_chain do
       if chain =~ INTERNAL_CHAINS
         # can't delete internal chains
         warning "Attempting to destroy internal chain #{@resource[:name]}"
+      else
+        debug "Deleting chain #{chain} on table #{table}"
+        t.call ['-t', table, '-X', chain]
       end
-      debug "Deleting chain #{chain} on table #{table}"
-      t.call ['-t', table, '-X', chain]
     end
   end