From: Jonathan Boyett Date: Fri, 13 May 2011 20:37:59 +0000 (-0700) Subject: munge is data to be of the same type as should X-Git-Tag: v0.0.1~57 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d930aeabba3fef673ff76d16a58865de3bb27dc5;p=puppet-modules%2Fpuppetlabs-firewall.git munge is data to be of the same type as should --- 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