mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 13:03:02 +02:00
statd: allow ethtool --json to fail without breaking operational ds
On boards like the R2S and the VisionFive2 `ethtool --json -S ethX` is not yet supported. This patch allows ethtool to fail, with a slightly better log message, without breaking the operational datastore. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -621,10 +621,10 @@ def add_ethtool_groups(ifname, iface_out):
|
||||
"""Fetch interface counters from kernel"""
|
||||
|
||||
data = run_json_cmd(['ethtool', '--json', '-S', ifname, '--all-groups'],
|
||||
f"ethtool-groups-{ifname}.json")
|
||||
f"ethtool-groups-{ifname}.json")
|
||||
if len(data) != 1:
|
||||
print("Error: expected ethtool groups output to be array with length 1", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
print(f"Error: no counters available for {ifname}, skipping.")
|
||||
return
|
||||
|
||||
iface_in = data[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user