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)
# Someone else has the pidfile locked.
try:
try:
# 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))
except IOError, e:
logging.warning("%s: read: %s" % (pidfile, e.strerror))
except ValueError:
logging.warning("%s does not contain a pid" % pidfile)
except ValueError:
logging.warning("%s does not contain a pid" % pidfile)
+ error = -errno.EINVAL
+
+ return error
finally:
try:
file_handle.close()
finally:
try:
file_handle.close()