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

addons: ethtool: fec: only use and compare lowercase data

on --show-fec ethtool seems to return fec in uppercase while
we only advertise lowercase validvals. We should only deal
and compare lowercase values for running, config and default

root@host:/home/cumulus# /sbin/ethtool --show-fec swp29
FEC parameters for swp29:
FEC encodings   : RS
root@host:/home/cumulus#

testing:
set: link-fec rs
ifup/ifreloads

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2018-11-06 01:35:37 +01:00
parent 0c4237d58d
commit fc0026de84

View File

@@ -86,8 +86,17 @@ class ethtool(moduleBase,utilsBase):
# if we have no default and the user did not have settings
return
# check running values
# use only lowercase values
running_val = self.get_running_attr('fec', ifaceobj)
if running_val:
running_val = running_val.lower()
if config_val:
config_val = config_val.lower()
if default_val:
default_val = default_val.lower()
# check running values
if config_val and config_val == running_val:
return