mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-11-22 18:00:41 +08:00
dns-reverse-generator.py: cannot take ipv6
This commit is contained in:
parent
3efa90fff5
commit
bd1c8ba0d4
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import sys
|
import sys
|
||||||
from ipaddress import IPv4Address, ip_network
|
from ipaddress import IPv4Address, ip_network, IPv4Network
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import toml
|
import toml
|
||||||
|
@ -16,7 +16,7 @@ def iter_route(route_type: str):
|
||||||
items.extend(
|
items.extend(
|
||||||
(entity["name"], ip_network(route).network_address)
|
(entity["name"], ip_network(route).network_address)
|
||||||
for route, entity in routes.items()
|
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])
|
return sorted(items, key=lambda item: item[1])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue