Merge "Ensure TTL is not 0 for zone imports"

This commit is contained in:
Jenkins 2017-06-28 17:47:24 +00:00 committed by Gerrit Code Review
commit a989d0d778
1 changed files with 2 additions and 0 deletions

View File

@ -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 = {