summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-03-23 18:55:02 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-03-23 19:02:04 -0500
commitb48e9a7c4cc89546aaf4a40f71535acfddc7e4d3 (patch)
tree8570406654fe8191fef9688741e46534746b3f8f
parentb49c10c43266b053ff662cde8bbd110e17767a2b (diff)
downloadvyos-1x-b48e9a7c4cc89546aaf4a40f71535acfddc7e4d3.tar.gz
vyos-1x-b48e9a7c4cc89546aaf4a40f71535acfddc7e4d3.zip
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.
-rwxr-xr-xsrc/op_mode/interfaces.py6
1 files changed, 5 insertions, 1 deletions
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)