1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: ethtool: FEC: translate None and NotSupported values to link-fec off

$ /sbin/ethtool --show-fec swp42
FEC parameters for swp42:
FEC encodings   : None
$ ifquery swp42
auto swp42
iface swp42
      link-fec off

$ ifreload -av |& grep ethtool
info: executing /sbin/ethtool swp42
info: executing /sbin/ethtool --show-fec swp42
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2018-11-30 17:16:01 -08:00
parent d54d014d9c
commit 6328de59d2

View File

@@ -87,15 +87,17 @@ class ethtool(moduleBase,utilsBase):
return
# use only lowercase values
running_val = self.get_running_attr('fec', ifaceobj)
running_val = str(self.get_running_attr('fec', ifaceobj)).lower()
if running_val:
running_val = running_val.lower()
if config_val:
config_val = config_val.lower()
if default_val:
default_val = default_val.lower()
if running_val in ["none", "notsupported"]:
# None and NotSupported ethtool FEC values mean "off"
running_val = "off"
# check running values
if config_val and config_val == running_val:
return