From 0c2eeee8c7fc4b3a26083ef2f04ebde0c96560c6 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 12 May 2016 12:53:42 +0200 Subject: [PATCH] BF: fail2ban-client can't unserialize IPAddr objects - added IPAddr pickle-handler, that simple wrap IPAddr to the str --- fail2ban/server/ipdns.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fail2ban/server/ipdns.py b/fail2ban/server/ipdns.py index bca03428..880e3f30 100644 --- a/fail2ban/server/ipdns.py +++ b/fail2ban/server/ipdns.py @@ -233,6 +233,14 @@ class IPAddr(object): def __str__(self): return self.ntoa + + def __reduce__(self): + """IPAddr pickle-handler, that simple wrap IPAddr to the str + + Returns a string as instance to be pickled, because fail2ban-client can't + unserialize IPAddr objects + """ + return (str, (self.ntoa,)) @property def addr(self):