support mutiple ipv6, and no origin v4
This commit is contained in:
parent
d321aeb2ea
commit
be31f657f6
1 changed files with 8 additions and 3 deletions
11
main.py
11
main.py
|
@ -76,7 +76,10 @@ def write_dns_files(api_client):
|
|||
expire=zone['soa']['expire'],
|
||||
ttl=zone['soa']['ttl'])
|
||||
|
||||
originv4 = template_originv4.format(ipv4=zone['originv4']['ipv4'])
|
||||
if zone['originv4'] is not None:
|
||||
originv4 = template_originv4.format(ipv4=zone['originv4']['ipv4'])
|
||||
else:
|
||||
originv4 = ""
|
||||
if zone['originv6'] is not None:
|
||||
originv6 = template_originv6.format(ipv6=zone['originv6'])
|
||||
else:
|
||||
|
@ -119,8 +122,10 @@ def write_dns_files(api_client):
|
|||
|
||||
aaaa_records = "\n".join(
|
||||
template_aaaa.format(hostname=x['hostname'],
|
||||
ipv6=x['ipv6'])
|
||||
for x in zone['aaaa_records'] if x['ipv6'] is not None
|
||||
ipv6=ip['ipv6'])
|
||||
for x in zone['aaaa_records']
|
||||
for ip in x['ipv6']
|
||||
if x['ipv6'] is not None
|
||||
)
|
||||
|
||||
cname_records = "\n".join(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue