]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
remove array length validation from dport and sport
authorJonathan Boyett <jonathan@failingservers.com>
Thu, 16 Jun 2011 18:59:13 +0000 (11:59 -0700)
committerJonathan Boyett <jonathan@failingservers.com>
Thu, 16 Jun 2011 18:59:13 +0000 (11:59 -0700)
lib/puppet/type/firewall.rb
spec/type/iptables_type_spec.rb

index c5487f3dea00c7b5c92be7fc94e8b93d96d11a25..2d6531d2f4012aad524d98c9a97474b38a704c66 100644 (file)
@@ -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
index a76a358a20d6e49a68cc8d1fa51bef4a472a62d1..8ff371541128c5d0795b764d8a8daec38a32ee22 100644 (file)
@@ -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