]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
munge is data to be of the same type as should
authorJonathan Boyett <jonathan@failingservers.com>
Fri, 13 May 2011 20:37:59 +0000 (13:37 -0700)
committerJonathan Boyett <jonathan@failingservers.com>
Fri, 13 May 2011 20:37:59 +0000 (13:37 -0700)
lib/puppet/provider/firewall/iptables.rb

index b8dd479ffcbba437656c4139b2873d01041b0971..9370012c0c7df77efe38ab3b86bde763cee967fd 100644 (file)
@@ -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