prefix v6 length from server
This commit is contained in:
parent
ccecfa4e19
commit
2224e3b563
1 changed files with 2 additions and 3 deletions
5
main.py
5
main.py
|
@ -247,8 +247,8 @@ def write_dns_reverse_file(api_client):
|
|||
|
||||
|
||||
### Continue with the ipv6 reverse
|
||||
# hack because we do not have the /64 info
|
||||
net = netaddr.IPNetwork(zone['prefix_v6']+"/64")
|
||||
net = netaddr.IPNetwork(zone['prefix_v6']+"/"+str(zone['prefix_v6_length']))
|
||||
print(net)
|
||||
net_class = max(((net.prefixlen - 1) // 4) + 1, 1)
|
||||
zone6_name = ".".join(
|
||||
netaddr.IPAddress(net.first).reverse_dns.split('.')[32 - net_class:]
|
||||
|
@ -263,7 +263,6 @@ def write_dns_reverse_file(api_client):
|
|||
expire=zone['soa']['expire'],
|
||||
ttl=zone['soa']['ttl'])
|
||||
|
||||
net = netaddr.IPNetwork(zone['prefix_v6']+"/64")
|
||||
prefix_length = int((128 - net.prefixlen)/4)
|
||||
ptr_records = "\n".join(
|
||||
template_ptr.format(hostname=host['hostname']+extension,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue