1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-22 06:10:42 +08:00

dns-reverse-generator.py: cannot take ipv6

This commit is contained in:
JerryXiao 2020-09-19 13:46:19 +08:00
parent 3efa90fff5
commit bd1c8ba0d4
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import sys
from ipaddress import IPv4Address, ip_network
from ipaddress import IPv4Address, ip_network, IPv4Network
from pathlib import Path
import toml
@ -16,7 +16,7 @@ def iter_route(route_type: str):
items.extend(
(entity["name"], ip_network(route).network_address)
for route, entity in routes.items()
if entity["type"] == route_type
if entity["type"] == route_type and isinstance(ip_network(route), IPv4Network)
)
return sorted(items, key=lambda item: item[1])