From ee0ce118a9dc038ec80954170579901b2d25fe00 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 12 Oct 2005 01:43:55 +0000 Subject: [PATCH] wrapped with exception handling to avoid crash during pidlock remove --- utils/pidlock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/pidlock.py b/utils/pidlock.py index 40ca5385..c3de5745 100644 --- a/utils/pidlock.py +++ b/utils/pidlock.py @@ -70,6 +70,9 @@ class PIDLock: logSys.debug("Removed PID lock " + self.path) except OSError: logSys.error("Unable to remove PID lock " + self.path) + # AttributeError if self.path wasn't specified yet + except AttributeError: + logSys.debug("PID lock not removed because not defined yet") def exists(self): """ Returns the current PID if Fail2Ban is running or False @@ -103,4 +106,4 @@ class PIDLock: def __setattr__(self, attr, value): """ Delegate access to implementation """ return setattr(self.__instance, attr, value) - \ No newline at end of file +