Skip to content

Commit

Permalink
dropped NetworkInterfaces#device_type
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Sep 19, 2018
1 parent 6782942 commit 76c0b3e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions library/network/src/modules/NetworkInterfaces.rb
Expand Up @@ -191,15 +191,6 @@ def ifcfg_part(ifcfg, part)
ret.nil? ? "" : ret
end

# Return a device type
# @param [String] dev device
# @return device type
# @example device_type("eth1") -> "eth"
# @example device_type("eth-pcmcia-0") -> "eth"
def device_type(dev)
ifcfg_part(dev, "1")
end

# Detects a subtype of Ethernet device type according /sys or /proc content
#
# @example
Expand Down Expand Up @@ -342,7 +333,9 @@ def GetTypeFromIfcfgOrName(dev, ifcfg)

type = GetTypeFromIfcfg(ifcfg) if IsEmpty(type)

type = device_type(dev) if type.nil?
# last instance - no record in sysfs, no configuration, device
# name is not bounded to a type -> use fallbac "eth" as wicked already does
type = "eth" if type.nil?

log.debug("GetTypeFromIfcfgOrName: device='#{dev}' type='#{type}'")

Expand Down

0 comments on commit 76c0b3e

Please sign in to comment.