diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/resource/windows_firewall_rule.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb index 02c9126690..db362375ba 100644 --- a/lib/chef/resource/windows_firewall_rule.rb +++ b/lib/chef/resource/windows_firewall_rule.rb @@ -252,13 +252,14 @@ class Chef elsif icmp_type.is_a?(String) return false if !protocol.start_with?("ICMP") && icmp_type !~ /^\D+$/ return false if icmp_type.count("a-zA-Z") > 0 && icmp_type.count(":") > 1 - return false if !(0..255).include?(icmp_type.to_i) + return false unless (0..255).include?(icmp_type.to_i) if protocol.start_with?("ICMP") && icmp_type.include?(":") return icmp_type.split(":").all? { |type| (0..255).include?(type.to_i) } end - true + # the following has to be disabled, as this works like a safeguard + true # rubocop:disable Style/RedundantReturn end end end |