bug fixes

This commit is contained in:
Charlie Jacomme 2018-07-16 21:08:27 +02:00
parent 2224e3b563
commit 4b293167e9

View file

@ -241,14 +241,13 @@ def write_dns_reverse_file(api_client):
mx_records=mx_records,
ptr_records = ptr_records)
filename = 'dns.{zone}zone'.format(zone=zone_name)
filename = 'dns.{zone}.zone'.format(zone=zone_name)
with open(filename, 'w+') as f:
f.write(zone_file_content)
### Continue with the ipv6 reverse
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:]