]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(maint) Typo fixes (#844)
authorGeorgeCox <G.H.Cox@bath.ac.uk>
Mon, 3 Jun 2019 16:10:57 +0000 (17:10 +0100)
committerEimhin Laverty <eimlav@users.noreply.github.com>
Mon, 3 Jun 2019 16:10:57 +0000 (17:10 +0100)
* Changed case of error message

Changed the case of the tables in the error message when defining a custom chain. The error message shows the tables in uppercase (as you'd see when using iptables directly), while the regex in lib/puppet/provider/firewallchain/iptables_chain.rb is expecting lowercase. It looks like lib/puppet/provider/firewallchain/iptables_chain.rb is expecting the default chains in uppercase so I have left those.

* Corrected typo, hyphen not yphen

lib/puppet/type/firewall.rb
lib/puppet/type/firewallchain.rb

index 3a3214215ac05357d25b7a83a7ce7335951cd871..297589a706d38d91d9196bb229ab136c9dca5eed 100644 (file)
@@ -619,7 +619,7 @@ Puppet::Type.newtype(:firewall) do
       unless value =~ %r{^[a-zA-Z0-9\-_]+$}
         raise ArgumentError, <<-PUPPETCODE
           Jump destination must consist of alphanumeric characters, an
-          underscore or a yphen.
+          underscore or a hyphen.
         PUPPETCODE
       end
 
@@ -652,7 +652,7 @@ Puppet::Type.newtype(:firewall) do
       unless value =~ %r{^[a-zA-Z0-9\-_]+$}
         raise ArgumentError, <<-PUPPETCODE
           Goto destination must consist of alphanumeric characters, an
-          underscore or a yphen.
+          underscore or a hyphen.
         PUPPETCODE
       end
 
index f45afe02cadcdf61e6b8128ad96d628ca167354b..f6aa70992a90f1ef668f6f53bf2af88c605f08c3 100644 (file)
@@ -49,8 +49,8 @@ Puppet::Type.newtype(:firewallchain) do
 
     validate do |value|
       if value !~ NAME_FORMAT
-        raise ArgumentError, 'Inbuilt chains must be in the form {chain}:{table}:{protocol} where {table} is one of FILTER,' \
-            ' NAT, MANGLE, RAW, RAWPOST, BROUTE, SECURITY or empty (alias for filter), chain can be anything without colons' \
+        raise ArgumentError, 'Inbuilt chains must be in the form {chain}:{table}:{protocol} where {table} is one of filter,' \
+            ' nat, mangle, raw, rawpost, broute, security or empty (alias for filter), chain can be anything without colons' \
             ' or one of PREROUTING, POSTROUTING, BROUTING, INPUT, FORWARD, OUTPUT for the inbuilt chains, and {protocol} being' \
             " IPv4, IPv6, ethernet (ethernet bridging) got '#{value}' table:'#{Regexp.last_match(1)}' chain:'#{Regexp.last_match(2)}' protocol:'#{Regexp.last_match(3)}'"
       else