summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_stats.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-06-07 13:35:37 -0400
committerOle Trøan <otroan@employees.org>2019-06-18 12:19:55 +0000
commitae8819f0a426953aa7ebf97c2e26940525b55fb1 (patch)
treeeba8fcf6fabc0b1ec1de5febc8c214030e1b74b1 /src/vpp-api/python/vpp_papi/vpp_stats.py
parent283cd2e9afcab1407d5614d79da4354790fa059a (diff)
misc: vpp_papi- add tests, clean up pep8
Type: test Change-Id: Ic81bd4a9eba3c89a746e7a9b9e471b59cd87fa40 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_stats.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_stats.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 590549a17bd..3638892135f 100644
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -86,7 +86,7 @@ char *stat_segment_index_to_name_r (uint32_t index, stat_client_main_t * sm);
uint64_t stat_segment_version(void);
uint64_t stat_segment_version_r(stat_client_main_t *sm);
void free(void *ptr);
-""")
+""") # noqa: E501
# Utility functions
@@ -130,12 +130,14 @@ def combined_counter_vec_list(api, e):
vec.append(if_per_thread)
return vec
+
def error_vec_list(api, e):
vec = []
for thread in range(api.stat_segment_vec_len(e)):
vec.append(e[thread])
return vec
+
def name_vec_list(api, e):
return [ffi.string(e[i]).decode('utf-8') for i in
range(api.stat_segment_vec_len(e)) if e[i] != ffi.NULL]
@@ -175,7 +177,7 @@ class VPPStatsIOError(IOError):
if not message:
try:
message = self.message % kwargs
- except Exception as e:
+ except Exception:
message = self.message
else:
message = message % kwargs
@@ -258,7 +260,7 @@ class VPPStats(object):
.format(name))
k, v = s.popitem()
return v
- except VPPStatsIOError as e:
+ except VPPStatsIOError:
if retries > 10:
return None
retries += 1
@@ -280,7 +282,7 @@ class VPPStats(object):
error_names = self.ls(['/err/'])
error_counters = self.dump(error_names)
break
- except VPPStatsIOError as e:
+ except VPPStatsIOError:
if retries > 10:
return None
retries += 1