]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES-8543) Remove nftables' backend warning from iptables_save output
authorPedro González Serrano <niteman.es@gmail.com>
Wed, 1 Apr 2020 10:49:22 +0000 (12:49 +0200)
committerPedro González Serrano <niteman.es@gmail.com>
Wed, 1 Apr 2020 10:51:56 +0000 (12:51 +0200)
lib/puppet/provider/firewall/iptables.rb

index c0afbcb784fa55e5df32a761f6751c93ac0b124e..7f8f9fc17cd67f20b6a3af92a7a3cf6d8a971dfe 100644 (file)
@@ -406,7 +406,8 @@ Puppet::Type.type(:firewall).provide :iptables, parent: Puppet::Provider::Firewa
     counter = 1
 
     # String#lines would be nice, but we need to support Ruby 1.8.5
-    iptables_save.split("\n").each do |line|
+    nf_warning_msg = "# Warning: iptables-legacy tables present, use iptables-legacy-save to see them\n"
+    iptables_save.gsub(nf_warning_msg, '').split("\n").each do |line|
       unless line =~ %r{^\#\s+|^\:\S+|^COMMIT|^FATAL}
         if line =~ %r{^\*}
           table = line.sub(%r{\*}, '')