From d930aeabba3fef673ff76d16a58865de3bb27dc5 Mon Sep 17 00:00:00 2001 From: Jonathan Boyett Date: Fri, 13 May 2011 13:37:59 -0700 Subject: [PATCH] munge is data to be of the same type as should --- lib/puppet/provider/firewall/iptables.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/firewall/iptables.rb b/lib/puppet/provider/firewall/iptables.rb index b8dd479..9370012 100644 --- a/lib/puppet/provider/firewall/iptables.rb +++ b/lib/puppet/provider/firewall/iptables.rb @@ -103,10 +103,16 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir keys << :chain keys.zip(values.scan(/"[^"]*"|\S+/).reverse) { |f, v| hash[f] = v.gsub(/"/, '') } + [:dport, :sport, :destination, :source, :state].each do |prop| + if hash[prop] =~ /,/ + hash[prop] = hash[prop].split(',') + else + hash[prop] = [hash[prop]] + end + end hash[:provider] = self.name.to_s hash[:table] = table hash[:ensure] = :present - hash[:rulenum] = counter hash end -- 2.45.2