stats: check epoch in python vpp_stats ls 27/33627/3
authorOle Troan <ot@cisco.com>
Tue, 31 Aug 2021 08:47:45 +0000 (10:47 +0200)
committerDamjan Marion <dmarion@me.com>
Tue, 31 Aug 2021 15:26:11 +0000 (15:26 +0000)
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>
src/vpp-api/python/vpp_papi/vpp_stats.py

index b9b23b5..3831a82 100755 (executable)
@@ -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)]