From b48e9a7c4cc89546aaf4a40f71535acfddc7e4d3 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 23 Mar 2023 18:55:02 -0500 Subject: op-mode: T5097: show interfaces should reflect cleared counters 'show interfaces counters' correctly displays counter stats after a call to 'clear interfaces counters', however, 'show interfaces detail' does not. Add missing update to counter stats. --- src/op_mode/interfaces.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/op_mode/interfaces.py b/src/op_mode/interfaces.py index 678c74980..7d04ec4e3 100755 --- a/src/op_mode/interfaces.py +++ b/src/op_mode/interfaces.py @@ -207,7 +207,11 @@ def _get_raw_data(ifname: typing.Optional[str], res_intf['description'] = interface.get_alias() - res_intf['stats'] = interface.operational.get_stats() + stats = interface.operational.get_stats() + for k in list(stats): + stats[k] = _get_counter_val(cache[k], stats[k]) + + res_intf['stats'] = stats ret.append(res_intf) -- cgit v1.2.3