]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: ethtool: skip speed zero from query running
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Tue, 9 Aug 2016 06:15:20 +0000 (23:15 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Tue, 9 Aug 2016 06:17:43 +0000 (23:17 -0700)
kernel might return running speed 0 if port does
not have carrier

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
addons/ethtool.py

index c2d4771b1bd4cc04eb5e12b0ed7e8a77e5b0c125..736d4ee0738e0264a919b0d8f03df1d0fdcf42a6 100644 (file)
@@ -243,6 +243,10 @@ class ethtool(moduleBase,utilsBase):
             # to see the defaults, we should implement another flag (--with-defaults)
             if default_val == running_attr:
                 continue
+
+            # do not proceed if speed = 0
+            if attr == 'speed' and running_attr and running_attr == '0':
+                return
             if running_attr:
                 ifaceobj.update_config('link-%s'%attr, running_attr)