summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-09-16 16:46:18 -0700
committerEthan Jackson <ethan@nicira.com>2011-09-16 18:27:33 -0700
commit2a8859b0a4fe11c6418fe07dbb9b1c403a3986b4 (patch)
tree0326c4961af848b7d20b4c5deda3a5d4a05fba40
parent591c20651f18b158294d0f0456c2cb92b4051031 (diff)
downloadopenvswitch-2a8859b0a4fe11c6418fe07dbb9b1c403a3986b4.tar.gz
daemon.py: Silence return warning.
Pychecker complains about __read_pidfile() having too may returns. I personally think the function is fine, but it's easy enough to reduce them. python/ovs/daemon.py:395: Function (__read_pidfile) has too many returns (12)
-rw-r--r--python/ovs/daemon.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py
index 5b9b06ac2..184e7832f 100644
--- a/python/ovs/daemon.py
+++ b/python/ovs/daemon.py
@@ -457,13 +457,15 @@ def __read_pidfile(pidfile, delete_if_stale):
# Someone else has the pidfile locked.
try:
try:
- return int(file_handle.readline())
+ error = int(file_handle.readline())
except IOError, e:
logging.warning("%s: read: %s" % (pidfile, e.strerror))
- return -e.errno
+ error = -e.errno
except ValueError:
logging.warning("%s does not contain a pid" % pidfile)
- return -errno.EINVAL
+ error = -errno.EINVAL
+
+ return error
finally:
try:
file_handle.close()