From: Pedro González Serrano Date: Wed, 1 Apr 2020 10:49:22 +0000 (+0200) Subject: (MODULES-8543) Remove nftables' backend warning from iptables_save output X-Git-Tag: v2.4.0~5^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=80db8ece3295f074ff6492870504a284afd28cbf;p=puppet-modules%2Fpuppetlabs-firewall.git (MODULES-8543) Remove nftables' backend warning from iptables_save output --- diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index c0afbcb..7f8f9fc 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -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{\*}, '')