aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-08-31 10:47:45 +0200
committerDamjan Marion <dmarion@me.com>2021-08-31 15:26:11 +0000
commit43eb6083c5819062c4d65bf3a2072ac67939a1f2 (patch)
tree9e9904c2ebbb58c87ae5008698584c0113ec5baf
parent7311f1863a4eb7d723c557277df90e33c451b20d (diff)
stats: check epoch in python vpp_stats ls
The VPP Stats Python binding was missing checking epoch. Resulting it would not pick up changes in the directory. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I3226d71c77be2e80e24b5cd48fc9820833f7d30e Signed-off-by: Ole Troan <ot@cisco.com>
-rwxr-xr-xsrc/vpp-api/python/vpp_papi/vpp_stats.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index b9b23b52d66..3831a82f428 100755
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -280,6 +280,9 @@ class VPPStats():
if not isinstance(patterns, list):
patterns = [patterns]
regex = [re.compile(i) for i in patterns]
+ if self.last_epoch != self.epoch:
+ self.refresh()
+
return [k for k, v in self.directory.items()
if any(re.match(pattern, k) for pattern in regex)]