Skip to content

Commit

Permalink
(maint) Typo fixes (#844)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
GeorgeCox authored and eimlav committed Jun 3, 2019
1 parent 81f9b95 commit b834cde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/type/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def should_to_s(value)
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

Expand Down Expand Up @@ -652,7 +652,7 @@ def should_to_s(value)
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

Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/type/firewallchain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

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
Expand Down

0 comments on commit b834cde

Please sign in to comment.