diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2024-11-05 20:25:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 20:25:18 +0200 |
commit | 09ca8e2a01fcef509d6f39e0abbe7a65fa1eb5b8 (patch) | |
tree | 7d0aca6b334360505b7dc810d3dd5eeb69bc9670 /python/vyos | |
parent | 47aa697fd646accc2f333f6409885640a9631e2e (diff) | |
download | vyos-1x-09ca8e2a01fcef509d6f39e0abbe7a65fa1eb5b8.tar.gz vyos-1x-09ca8e2a01fcef509d6f39e0abbe7a65fa1eb5b8.zip |
T6764: Fix unhandled exception on ethtool output parsing for Xen NICs (#4182)
Not all NICs could provide ring-buffers info requested by ethtool
in JSON format
For example 'vif' Xen/XCP-NG interfaces
Fix it
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ethtool.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py index 21272cc5b..4710a5d40 100644 --- a/python/vyos/ethtool.py +++ b/python/vyos/ethtool.py @@ -23,7 +23,7 @@ from vyos.utils.process import popen # flow control settings _drivers_without_speed_duplex_flow = ['vmxnet3', 'virtio_net', 'xen_netfront', 'iavf', 'ice', 'i40e', 'hv_netvsc', 'veth', 'ixgbevf', - 'tun'] + 'tun', 'vif'] class Ethtool: """ @@ -101,8 +101,9 @@ class Ethtool: self._features = loads(out)[0] # Get information about NIC ring buffers - out, _ = popen(f'ethtool --json --show-ring {ifname}') - self._ring_buffer = loads(out)[0] + out, err = popen(f'ethtool --json --show-ring {ifname}') + if not bool(err): + self._ring_buffer = loads(out)[0] # Get current flow control settings, but this is not supported by # all NICs (e.g. vmxnet3 does not support is) |