]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES-8543) Extend nftables' backend warning removal to ip6tables
authorPedro González Serrano <niteman.es@gmail.com>
Tue, 14 Apr 2020 06:38:14 +0000 (08:38 +0200)
committerPedro González Serrano <niteman.es@gmail.com>
Tue, 14 Apr 2020 06:42:38 +0000 (08:42 +0200)
lib/puppet/provider/firewall/iptables.rb

index 7f8f9fc17cd67f20b6a3af92a7a3cf6d8a971dfe..8af16afa8bd52c7a74218b5745fa17f502aa24cd 100644 (file)
@@ -406,8 +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
-    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|
+    nf_warning_msg = "# Warning: ip6?tables-legacy tables present, use ip6?tables-legacy-save to see them\n"
+    iptables_save.gsub(%r{#{nf_warning_msg}}, '').split("\n").each do |line|
       unless line =~ %r{^\#\s+|^\:\S+|^COMMIT|^FATAL}
         if line =~ %r{^\*}
           table = line.sub(%r{\*}, '')