From: Ben Pfaff Date: Mon, 22 Aug 2011 21:40:09 +0000 (-0700) Subject: daemon: Stylistic improvement for __read_pidfile in Python implementation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0233401f12fe5ef8f9d63d660d2bd3f739766025;p=openvswitch daemon: Stylistic improvement for __read_pidfile in Python implementation. Suggested-by: Reid Price --- diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 5aa5bc10..da7eb8ae 100644 --- a/python/ovs/daemon.py +++ b/python/ovs/daemon.py @@ -422,10 +422,10 @@ def __read_pidfile(pidfile, delete_if_stale): logging.warning("%s: failed to delete stale pidfile" % (pidfile, e.strerror)) return -e.errno - - logging.debug("%s: deleted stale pidfile" % pidfile) - file.close() - return 0 + else: + logging.debug("%s: deleted stale pidfile" % pidfile) + file.close() + return 0 except IOError, e: if e.errno not in [errno.EACCES, errno.EAGAIN]: logging.warn("%s: fcntl: %s" % (pidfile, e.strerror))