ipv6 reverse fix

This commit is contained in:
Charlie Jacomme 2018-08-08 11:59:24 +02:00
parent a56e9c444c
commit 3fc12f6007

View file

@ -262,7 +262,7 @@ def write_dns_reverse_file(api_client):
net_class = max(((net.prefixlen - 1) // 4) + 1, 1)
zone6_name = ".".join(
netaddr.IPAddress(net.first).reverse_dns.split('.')[32 - net_class:]
)
)[:-1]
soa = template_soa.format(zone=zone6_name,
@ -288,7 +288,7 @@ def write_dns_reverse_file(api_client):
ptr_records = ptr_records)
filename = 'generated/dns.{zone}zone'.format(zone=zone6_name)
filename = 'generated/dns.{zone}.zone'.format(zone=zone6_name)
with open(filename, 'a') as f:
f.write(zone_file_content)
else:
@ -299,7 +299,7 @@ def write_dns_reverse_file(api_client):
ptr_records = ptr_records)
filename = 'generated/dns.{zone}zone'.format(zone=zone6_name)
filename = 'generated/dns.{zone}.zone'.format(zone=zone6_name)
with open(filename, 'w+') as f:
f.write(zone_file_content)
zone_v6.append(zone6_name)