Test framework: StringIO fixes for Python3
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py
Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877
Signed-off-by: Ole Troan <ot@cisco.com>
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index bb6cdf5..06daaf8 100644
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -196,8 +196,13 @@
retries = 0
while True:
try:
- dir = self.ls(name)
- return self.dump(dir).values()[0]
+ d = self.ls(name)
+ s = self.dump(d)
+ if len(s) > 1:
+ raise AttributeError('Matches multiple counters {}'
+ .format(name))
+ k, v = s.popitem()
+ return v
except VPPStatsIOError as e:
if retries > 10:
return None