'Check ipaddress validate'

def check_is_ipv4_addr(self):

    rule1 = '(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.'
    rule2 = '(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'
    ipv4_regex = ('%s%s%s%s%s%s' % ('^', rule1, rule1, rule1, rule2, '$'))
    return bool(re.match(ipv4_regex, self.peer))
