Fix issue where octodns was failing on missing TTL value for NS records in PTR zones

This commit is contained in:
Matěj D 2023-02-06 15:48:22 +01:00 committed by GitHub
parent 3dd15f6b4b
commit d3c1d0f653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -110,10 +110,18 @@ class NetBoxDNSSource(octodns.provider.base.BaseProvider):
name = nb_record.name
if name == "@":
name = ""
nb_zone_default_ttl = nb_zone.default_ttl
if nb_record.ttl:
nb_ttl = nb_record.ttl
elif nb_record.type == "NS":
nb_ttl = nb_zone.soa_refresh
else:
nb_ttl = nb_zone_default_ttl
data = {
"name": name,
"type": nb_record.type,
"ttl": nb_record.ttl,
"ttl": nb_ttl,
"values": [],
}
rdata = dns.rdata.from_text("IN", nb_record.type, nb_record.value)