Skip to content

Commit

Permalink
Filter("netcard"): return everything except loopback (bsc#1058227)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Dec 4, 2017
1 parent 6f2e823 commit dbe4446
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions library/network/src/modules/NetworkInterfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def GetTypeFromSysfs(dev)
end

Builtins.y2debug(
"GetTypeFromSysFs: device='%1', sysfs type='%2', type='%3'",
"GetTypeFromSysfs: device='%1', sysfs type='%2', type='%3'",
dev,
sys_type,
type
Expand Down Expand Up @@ -786,9 +786,13 @@ def Filter(devices, devregex)
devices = deep_copy(devices)
return devices if devices.nil? || devregex.nil? || devregex == ""

regex = "^(#{@DeviceRegex[devregex] || devregex})[0-9]*$"
log.debug("regex=#{regex}")
devices.select! { |f, _d| f =~ /#{regex}/ }
if devregex == "netcard"
devices.delete("lo")
else
regex = "^(#{@DeviceRegex[devregex] || devregex})[0-9]*$"
log.debug("regex=#{regex}")
devices.select! { |f, _d| f =~ /#{regex}/ }
end
log.debug("devices=#{devices}")
devices
end
Expand Down

0 comments on commit dbe4446

Please sign in to comment.