From 5d9ae0ce395beedab34277b1836dae7181d5309e Mon Sep 17 00:00:00 2001 From: Graham Hayes Date: Thu, 11 May 2017 12:15:23 -0400 Subject: [PATCH] Ensure TTL is not 0 for zone imports If zone imports have a ttl of 0 update the zone ttl to the min_ttl configured for the designate install Change-Id: Idec854997fa9b6ad5d6af29bf6935c069dcbc40a Closes-Bug: #1586178 --- designate/dnsutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designate/dnsutils.py b/designate/dnsutils.py index 1e134e0f..39c59418 100644 --- a/designate/dnsutils.py +++ b/designate/dnsutils.py @@ -274,6 +274,8 @@ def from_dnspython_zone(dnspython_zone): soa = dnspython_zone.get_rdataset(dnspython_zone.origin, 'SOA') if soa is None: raise exceptions.BadRequest('An SOA record is required') + if soa.ttl == 0: + soa.ttl = cfg.CONF['service:central'].min_ttl email = soa[0].rname.to_text(omit_final_dot=True).decode('utf-8') email = email.replace('.', '@', 1) values = {