BF: fail2ban-client can't unserialize IPAddr objects - added IPAddr pickle-handler, that simple wrap IPAddr to the str

pull/1415/head
sebres 9 years ago
parent 9b72522a01
commit 0c2eeee8c7

@ -234,6 +234,14 @@ class IPAddr(object):
def __str__(self): def __str__(self):
return self.ntoa 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 @property
def addr(self): def addr(self):
return self._addr return self._addr

Loading…
Cancel
Save