diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-08-22 14:40:09 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-08-24 11:57:42 -0700 |
| commit | 0233401f12fe5ef8f9d63d660d2bd3f739766025 (patch) | |
| tree | a3162bd467e30052b8a814f09874f633db0a858f /python | |
| parent | a7675d4e56d5108c554de25e7772c2eb60470abc (diff) | |
| download | openvswitch-0233401f12fe5ef8f9d63d660d2bd3f739766025.tar.gz | |
daemon: Stylistic improvement for __read_pidfile in Python implementation.
Suggested-by: Reid Price <reid@nicira.com>
Diffstat (limited to 'python')
| -rw-r--r-- | python/ovs/daemon.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/ovs/daemon.py b/python/ovs/daemon.py index 5aa5bc10a..da7eb8aed 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)) |
