diff --git a/lib/puppet/provider/firewall/firewall.rb b/lib/puppet/provider/firewall/firewall.rb index 0121693e0..48e5c7e4d 100644 --- a/lib/puppet/provider/firewall/firewall.rb +++ b/lib/puppet/provider/firewall/firewall.rb @@ -472,7 +472,7 @@ def self.get_rules(context, basic, protocols = ['IPv4', 'IPv6']) # For each protocol protocols.each do |protocol| # Retrieve String containing all information - iptables_list = Puppet::Provider.execute($list_command[protocol]) + iptables_list = Puppet::Provider.execute($list_command[protocol], combine: false, failonfail: true) # Scan String to retrieve all Rules iptables_list.scan($table_regex).each do |table| table_name = table[0].scan($table_name_regex)[0][0] diff --git a/spec/unit/puppet/provider/firewall/firewall_output_parsing_spec.rb b/spec/unit/puppet/provider/firewall/firewall_output_parsing_spec.rb index 6b582c344..d5bbe235c 100644 --- a/spec/unit/puppet/provider/firewall/firewall_output_parsing_spec.rb +++ b/spec/unit/puppet/provider/firewall/firewall_output_parsing_spec.rb @@ -344,8 +344,8 @@ end it 'processes the resource' do - allow(Puppet::Util::Execution).to receive(:execute).with('iptables-save').and_return(iptables) - allow(Puppet::Util::Execution).to receive(:execute).with('ip6tables-save').and_return(ip6tables) + allow(Puppet::Util::Execution).to receive(:execute).with('iptables-save', { combine: false, failonfail: true }).and_return(iptables) + allow(Puppet::Util::Execution).to receive(:execute).with('ip6tables-save', { combine: false, failonfail: true }).and_return(ip6tables) expect(provider.get(context)).to eq(returned_data) end diff --git a/spec/unit/puppet/provider/firewallchain/firewallchain_spec.rb b/spec/unit/puppet/provider/firewallchain/firewallchain_spec.rb index eb3d1cc6f..804bfb47f 100644 --- a/spec/unit/puppet/provider/firewallchain/firewallchain_spec.rb +++ b/spec/unit/puppet/provider/firewallchain/firewallchain_spec.rb @@ -326,8 +326,8 @@ }, ].each do |test| before(:each) do - allow(Puppet::Util::Execution).to receive(:execute).with('iptables-save').and_return(iptables) - allow(Puppet::Util::Execution).to receive(:execute).with('ip6tables-save').and_return(ip6tables) + allow(Puppet::Util::Execution).to receive(:execute).with('iptables-save', { combine: false, failonfail: true }).and_return(iptables) + allow(Puppet::Util::Execution).to receive(:execute).with('ip6tables-save', { combine: false, failonfail: true }).and_return(ip6tables) end it "purge chain: '#{test[:should]}'" do