]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: ethtool: fec: only use and compare lowercase data
authorJulien Fortin <julien@cumulusnetworks.com>
Tue, 6 Nov 2018 00:35:37 +0000 (01:35 +0100)
committerJulien Fortin <julien@cumulusnetworks.com>
Thu, 13 Dec 2018 22:43:57 +0000 (14:43 -0800)
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>
ifupdown2/addons/ethtool.py

index fd00275ce93acd212c6517672a423e42ebe23d48..dbf41961fbad8b4cb8c1eb0d9f054569dadb29db 100644 (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