]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/networking/libraries/interfaces.rb
Rubocop cleanups
[chef.git] / cookbooks / networking / libraries / interfaces.rb
index fa0a93c7d7347ed63f53b1adb08bf5aa849134ee..cd9116dfa8be051956ef6550332e4dc1dbdb10f1 100644 (file)
@@ -7,14 +7,13 @@ class Chef
       networking_interfaces = networking[:interfaces] || []
 
       networking_interfaces.each_value  do |interface|
-        if options[:role].nil? || interface[:role].to_s == options[:role].to_s
-          if options[:family].nil? || interface[:family].to_s == options[:family].to_s
-            if block.nil?
-              interfaces << interface
-            else
-              block.call(interface)
-            end
-          end
+        next unless options[:role].nil? || interface[:role].to_s == options[:role].to_s
+        next unless options[:family].nil? || interface[:family].to_s == options[:family].to_s
+
+        if block.nil?
+          interfaces << interface
+        else
+          block.call(interface)
         end
       end