aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python
diff options
context:
space:
mode:
authorArthur de Kerhor <arthurdekerhor@gmail.com>2021-06-25 18:03:24 +0200
committerDave Wallace <dwallacelf@gmail.com>2021-06-25 23:26:40 +0000
commit905c15319c9a732b1bc785b8ce5a97d5817f26f8 (patch)
treedb37bb55251e20ae6728a37d03aced0f79ad419a /src/vpp-api/python
parent7816403eb2b539c259250ed82cd8367f74fec0e9 (diff)
stats: reverts part of a fix on Python client
Puts return statements back inside code blocks under the lock Type: fix Change-Id: I76d426f336200035026b92bcb0ffe2b472a3142d Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com>
Diffstat (limited to 'src/vpp-api/python')
-rwxr-xr-xsrc/vpp-api/python/vpp_papi/vpp_stats.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index b407b56a85f..b9b23b52d66 100755
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -200,9 +200,7 @@ class VPPStats():
self.error_vectors = []
for threads in StatsVector(self, self.error_vector, 'P'):
self.error_vectors.append(StatsVector(self, threads[0], 'Q'))
- # Return statement must be outside the lock block to be sure
- # lock.release is executed
- return
+ return
except IOError:
if not blocking:
raise
@@ -215,10 +213,7 @@ class VPPStats():
if self.last_epoch != self.epoch:
self.refresh(blocking)
with self.lock:
- result = self.directory[item].get_counter(self)
- # Return statement must be outside the lock block to be sure
- # lock.release is executed
- return result
+ return self.directory[item].get_counter(self)
except IOError:
if not blocking:
raise
@@ -245,7 +240,7 @@ class VPPStats():
total += per_thread[i]
if total:
result[k] = total
- return result
+ return result
except IOError:
if not blocking:
raise
@@ -272,10 +267,7 @@ class VPPStats():
if self.last_epoch != self.epoch:
self.refresh(blocking)
with self.lock:
- result = sum(self.directory[name].get_counter(self))
- # Return statement must be outside the lock block to be sure
- # lock.release is executed
- return result
+ return sum(self.directory[name].get_counter(self))
except IOError:
if not blocking:
raise