summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 16:44:33 +0200
committerPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 16:44:33 +0200
commit6b7d46cf47d04cfc6f714403b5c38228b16c254b (patch)
tree324af30b2b434657f0ff00a8fd62a3b59bdfea21 /lib
parent177275193e68f7dfc2a503485482e639d95809c9 (diff)
downloadchef-6b7d46cf47d04cfc6f714403b5c38228b16c254b.tar.gz
fix chefstyle error
Signed-off-by: Patrick Schaumburg <pschaumburg@tecracer.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb5
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