addons: ethtool: skip speed zero from query running

kernel might return running speed 0 if port does
not have carrier

Signed-off-by: Roopa Prabhu <[email protected]>
This commit is contained in:
Roopa Prabhu
2016-08-08 23:17:43 -07:00
parent 95432c3b81
commit 151d80248e
+4
View 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)