Skip to content

Commit

Permalink
Happy rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Mar 9, 2016
1 parent d206021 commit 61283f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/modules/LanItems.rb
Expand Up @@ -879,6 +879,13 @@ def getNetworkInterfaces
end
end

# Finds item_id by device name
#
# If an item is associated with config file of given name (ifcfg-<device>)
# then its id is returned
#
# @param [String] device name (e.g. eth0)
# @return index in Items or nil
def find_configured(device)
@Items.select { |_k, v| v["ifcfg"] == device }.keys.first
end
Expand Down
8 changes: 4 additions & 4 deletions test/network_autoyast_test.rb
Expand Up @@ -214,16 +214,16 @@ def nm_installed(installed)

let(:ay_old_id) do
{
"interfaces" => [{"device" => "eth-id-0.0.1111"}]
"interfaces" => [{ "device" => "eth-id-0.0.1111" }]
}
end
let(:ay_old_mac) do
{
"interfaces" => [{"device" => "eth-bus-00:11:22:33:44:55"}]
"interfaces" => [{ "device" => "eth-bus-00:11:22:33:44:55" }]
}
end
let(:ay_both_vers) do
{ "interfaces" => ay_old_id["interfaces"] + [{"device" => "eth0"}] }
{ "interfaces" => ay_old_id["interfaces"] + [{ "device" => "eth0" }] }
end

it "detects old style names in profile" do
Expand All @@ -238,7 +238,7 @@ def nm_installed(installed)
describe "#oldStyle" do
let(:ay_only_new) do
{
"interfaces" => [{"device" => "eth0"}]
"interfaces" => [{ "device" => "eth0" }]
}
end

Expand Down

0 comments on commit 61283f4

Please sign in to comment.