From 1990eeae649eaf0e50dd24d4f45bcc75b089a153 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 26 Dec 2013 09:31:45 +0000 Subject: [PATCH] BF: Ticket compared to non-Ticket type returns False --- fail2ban/server/ticket.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fail2ban/server/ticket.py b/fail2ban/server/ticket.py index 6d856be3..8d036b2d 100644 --- a/fail2ban/server/ticket.py +++ b/fail2ban/server/ticket.py @@ -53,10 +53,13 @@ class Ticket: return str(self) def __eq__(self, other): - return self.__ip == other.__ip and \ + try: + return self.__ip == other.__ip and \ round(self.__time,2) == round(other.__time,2) and \ self.__attempt == other.__attempt and \ self.__matches == other.__matches + except AttributeError: + return False def setIP(self, value): if isinstance(value, basestring):