def _ip_subnet_valid(self, ip, subnet): return ipaddr.IPAddress(ip) in ipaddr.IPNetwork(subnet.address)