From: Jonathan Boyett Date: Thu, 16 Jun 2011 18:59:13 +0000 (-0700) Subject: remove array length validation from dport and sport X-Git-Tag: v0.0.1~39 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0aa39b52cd036a40350229f4279bf670d611b1b8;p=puppet-modules%2Fpuppetlabs-firewall.git remove array length validation from dport and sport --- diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index c5487f3..2d6531d 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -93,12 +93,6 @@ Puppet::Type.newtype(:firewall) do desc "The value for the iptables --source-port parameter. If an array is specified, values will be passed to multiport module." - validate do |value| - if value.is_a?(Array) && value.length > 15 - self.fail "multiport module only accepts <= 15 ports" - end - end - munge do |value| @resource.string_to_port(value) end @@ -113,12 +107,6 @@ Puppet::Type.newtype(:firewall) do desc "The value for the iptables --destination-port parameter. If an array is specified, values will be passed to multiport module." - validate do |value| - if value.is_a?(Array) && value.length > 15 - self.fail "multiport module only accepts <= 15 ports" - end - end - munge do |value| @resource.string_to_port(value) end diff --git a/spec/type/iptables_type_spec.rb b/spec/type/iptables_type_spec.rb index a76a358..8ff3715 100644 --- a/spec/type/iptables_type_spec.rb +++ b/spec/type/iptables_type_spec.rb @@ -97,10 +97,6 @@ describe Puppet::Type.type(:firewall) do @resource[port] = ['22','23'] @resource[port].should == [22,23] end - - it "should fail if more that 15 #{port}s are specified" do - lambda { @resource[port] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17'] }.should raise_error(Puppet::Error) - end end end