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

pull/1415/head
sebres 2016-05-12 12:53:42 +02:00
parent 9b72522a01
commit 0c2eeee8c7
1 changed files with 8 additions and 0 deletions

View File

@ -234,6 +234,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):
return self._addr