From 0233401f12fe5ef8f9d63d660d2bd3f739766025 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 22 Aug 2011 14:40:09 -0700 Subject: [PATCH] daemon: Stylistic improvement for __read_pidfile in Python implementation. Suggested-by: Reid Price --- python/ovs/daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)) -- 2.30.2