Skip to content

Commit

Permalink
Happy rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Oct 13, 2020
1 parent 656cb22 commit 856f44e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/y2network/autoinst/interfaces_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ def load_generic(config, interface_section)
config.interface = config.name # in autoyast name and interface is same
if config.bootproto == BootProtocol::STATIC
if !interface_section.ipaddr
raise ArgumentError, "Configuration for #{config.name} is invalid #{interface_section.inspect}"
msg = "Configuration for #{config.name} is invalid #{interface_section.inspect}"
raise ArgumentError, msg
end

ipaddr = IPAddress.from_string(interface_section.ipaddr) if !interface_section.ipaddr.empty?
if !interface_section.ipaddr.empty?
ipaddr = IPAddress.from_string(interface_section.ipaddr)
end
# Assign first netmask, as prefixlen has precedence so it will overwrite it
ipaddr.netmask = interface_section.netmask if !interface_section.netmask.to_s.empty?
if !interface_section.prefixlen.to_s.empty?
Expand Down

0 comments on commit 856f44e

Please sign in to comment.