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>
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index b407b56..b9b23b5 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 @@
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 @@
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 @@
total += per_thread[i]
if total:
result[k] = total
- return result
+ return result
except IOError:
if not blocking:
raise
@@ -272,10 +267,7 @@
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