From 324787c0b4bf6b8208c781a4c79dc7f14e67d8d6 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Wed, 8 Jul 2015 15:38:37 +0000 Subject: [PATCH] Correct fcntl.flock use in Pidfile.unlock This change corrects Pidfile.unlock[1] implementation, indeed currently it uses fcntl.flock response as a condition but fcntl.flock is a "void" function. [1] neutron.agent.linux.daemon Closes-Bug: #1472725 Change-Id: If2320f29095ed388f9f6fe59d4d9b80d04adaa85 --- neutron/agent/linux/daemon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/neutron/agent/linux/daemon.py b/neutron/agent/linux/daemon.py index b4c7853b5..5d0abce62 100644 --- a/neutron/agent/linux/daemon.py +++ b/neutron/agent/linux/daemon.py @@ -121,8 +121,7 @@ class Pidfile(object): return self.pidfile def unlock(self): - if not not fcntl.flock(self.fd, fcntl.LOCK_UN): - raise IOError(_('Unable to unlock pid file')) + fcntl.flock(self.fd, fcntl.LOCK_UN) def write(self, pid): os.ftruncate(self.fd, 0) -- 2.45.2