From b834cde666f1e56776787b396df7f93a31a0b086 Mon Sep 17 00:00:00 2001 From: GeorgeCox Date: Mon, 3 Jun 2019 17:10:57 +0100 Subject: [PATCH] (maint) Typo fixes (#844) * 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 | 4 ++-- lib/puppet/type/firewallchain.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index 3a32142..297589a 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -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 diff --git a/lib/puppet/type/firewallchain.rb b/lib/puppet/type/firewallchain.rb index f45afe0..f6aa709 100644 --- a/lib/puppet/type/firewallchain.rb +++ b/lib/puppet/type/firewallchain.rb @@ -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 -- 2.45.2