]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/networking/recipes/default.rb
Revert incorrect rubocop auto-correction
[chef.git] / cookbooks / networking / recipes / default.rb
index fe01c04e5634919c7d15c04c41b524805e535d20..39611a9dfdb0e2aa5bde681cb40bbd2aa8921a9d 100644 (file)
@@ -23,7 +23,7 @@
 require "ipaddr"
 
 node[:networking][:interfaces].each do |name, interface|
-  if interface[:role] && role = node[:networking][:roles][interface[:role]]
+  if interface[:role] && (role = node[:networking][:roles][interface[:role]])
     if role[interface[:family]]
       node.set[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix]
       node.set[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway]
@@ -35,8 +35,10 @@ node[:networking][:interfaces].each do |name, interface|
 
   prefix = node[:networking][:interfaces][name][:prefix]
 
+  # rubocop:disable Style/RedundantParentheses
   node.set[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix)
   node.set[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix)
+  # rubocop:enable Style/RedundantParentheses
 end
 
 template "/etc/network/interfaces" do