- Handle "AttributeError" exception in remove()

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@206 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.5
Cyril Jaquier 2005-10-26 21:50:18 +00:00
parent 2c1a0785c5
commit 5556c78350
1 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,9 @@ class PIDLock:
logSys.debug("Removed PID lock " + self.path)
except OSError:
logSys.error("Unable to remove PID lock " + self.path)
except AttributeError:
# AttributeError if self.path wasn't specified yet
logSys.debug("PID lock not removed because not defined yet")
def exists(self):
""" Returns the current PID if Fail2Ban is running or False