Skip to content

Commit

Permalink
Happy rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jan 26, 2022
1 parent c9a6fff commit d4c9d01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/y2network/wicked/connection_config_writers/bonding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Bonding < Base
# @see Y2Network::ConnectionConfigWriters::Base#update_file
# @param conn [Y2Network::ConnectionConfig::Bonding] Configuration to write
def update_file(conn)
file.bonding_slaves = file_slaves(conn)
file.bonding_slaves = file_ports(conn)
file.bonding_module_opts = conn.options
file.bonding_master = "yes"
end
Expand All @@ -37,7 +37,7 @@ def update_file(conn)
# format
#
# @return [Hash<Integer, String>] indexed devices in the bonding
def file_slaves(conn)
def file_ports(conn)
conn.ports.each_with_index.with_object({}) { |(name, i), h| h[i] = name }
end
end
Expand Down
5 changes: 4 additions & 1 deletion src/lib/y2network/widgets/slave_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ module SlaveItems
def slave_items_from(add_ifaces, included_ifaces, config)
raise ArgumentError, "list of devices for adding cannot be nil" if add_ifaces.nil?
raise ArgumentError, "some interfaces must be selected" if included_ifaces.nil?
raise ArgumentError, "list of devices cannot be empty" if add_ifaces.empty? && !included_ifaces.empty?

if add_ifaces.empty? && !included_ifaces.empty?
raise ArgumentError, "list of devices cannot be empty"
end

textdomain "network"

Expand Down

0 comments on commit d4c9d01

Please sign in to comment.