Skip to content

Commit

Permalink
Update firewall.rb
Browse files Browse the repository at this point in the history
it's => its where applicable
  • Loading branch information
arjenz committed Jul 1, 2024
1 parent 810e7fa commit 3e00181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/puppet/provider/firewall/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class Puppet::Provider::Firewall::Firewall
# => multiport: (For some reason, the multiport arguments can't be)
# specified within the same "-m multiport", but works in seperate
# ones.
# => addrtype: Each instance of src_type/dst_type requires it's own preface
# => addrtype: Each instance of src_type/dst_type requires its own preface
#
@module_to_argument_mapping = {
physdev: [:physdev_in, :physdev_out, :physdev_is_bridged, :physdev_is_in, :physdev_is_out],
Expand Down Expand Up @@ -339,7 +339,7 @@ def insync?(context, _name, property_name, is_hash, should_hash)

is == should
when :source, :destination
# Ensure source/destination has it's valid mask before you compare it
# Ensure source/destination has its valid mask before you compare it
is_hash[property_name] == PuppetX::Firewall::Utility.host_to_mask(should_hash[property_name], should_hash[:protocol])
when :tcp_option, :ctproto, :hop_limit
# Ensure that the values are compared as strings
Expand Down Expand Up @@ -716,7 +716,7 @@ def self.process_get(_context, rule_hash, rule, counter)
# Certain OS can return the proto as it;s equivalent number and we make sure to convert it in that case
rule_hash[:proto] = PuppetX::Firewall::Utility.proto_number_to_name(rule_hash[:proto])

# If a dscp numer is found, also return it as it's valid class name
# If a dscp numer is found, also return it as its valid class name
rule_hash[:set_dscp_class] = PuppetX::Firewall::Utility.dscp_number_to_class(rule_hash[:set_dscp]) if rule_hash[:set_dscp]

rule_hash
Expand Down Expand Up @@ -966,7 +966,7 @@ def self.hash_to_rule(_context, _name, rule)
arguments += " #{[$resource_map[key][1], rule[key]].join(' ')}"
end
when :src_type, :dst_type, :ipset, :match_mark, :mss, :connmark
# Code for if value requires it's own flag each time it is applied
# Code for if value requires its own flag each time it is applied
split_command = $resource_map[key].split(%r{ })
negated_command = [split_command[0], split_command[1], '!', split_command[2]].join(' ')

Expand Down Expand Up @@ -1048,7 +1048,7 @@ def self.insert_order(context, name, chain, table, protocol)
# If the rule already exists, use it as the offset
offset_rule = name
else
# If it doesn't add it to the list and find it's ordered location
# If it doesn't add it to the list and find its ordered location
rules << name
new_rule_location = rules.sort.uniq.index(name)
offset_rule = if new_rule_location.zero?
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/type/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
type: "Enum['iptables', 'ip6tables', 'IPv4', 'IPv6']",
default: 'IPv4',
desc: <<-DESC
The protocol used to set the rule, it's allowed values have been expanded to bring it closer to its `firewallchain` counterpart.
The protocol used to set the rule, its allowed values have been expanded to bring it closer to its `firewallchain` counterpart.
Defaults to `IPv4`
Noted: this was previously defined as `provider`, however the resource_api does not allow this to be used as an attribute title.
Expand Down Expand Up @@ -301,7 +301,7 @@
ishasmorefrags: {
type: 'Optional[Boolean]',
desc: <<-DESC
Matches if the packet has it's 'more fragments' bit set.
Matches if the packet has its 'more fragments' bit set.
Specific to IPv6.
DESC
},
Expand Down

0 comments on commit 3e00181

Please sign in to comment.