def expand_netmask(self, netmask): """Expand netmask based on the terms in the database. Doesn't bother using the database for tiny networks""" network = IPy.IP(netmask) if network.len() < 32: return [serialize_ip(str(ip)) for ip in network] ips = self.ips_from_network(network) if network.prefixlen() % 8 !=0: ips = [ip for ip in ips if IPy.IP(deserialize_ip(ip)) in network] return ips
def expand_netmask(self, netmask): """Expand netmask based on the terms in the database. Doesn't bother using the database for tiny networks""" network = IPy.IP(netmask) if network.len() < 32: return [serialize_ip(str(ip)) for ip in network] ips = self.ips_from_network(network) if network.prefixlen() % 8 != 0: ips = [ip for ip in ips if IPy.IP(deserialize_ip(ip)) in network] return ips
def serde_case(ip): other = deserialize_ip(serialize_ip(ip)) eq_(ip, other)