Browse Source

Add support for TinyDNS TXT records

pull/343/head
Andy Hawkins 7 years ago
parent
commit
fbfc3f8bb9
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      octodns/source/tinydns.py

+ 18
- 1
octodns/source/tinydns.py View File

@ -20,7 +20,7 @@ from .base import BaseSource
class TinyDnsBaseSource(BaseSource):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = False
SUPPORTS = set(('A', 'CNAME', 'MX', 'NS'))
SUPPORTS = set(('A', 'CNAME', 'MX', 'NS', 'TXT'))
split_re = re.compile(r':+')
@ -45,6 +45,22 @@ class TinyDnsBaseSource(BaseSource):
'values': values,
}
def _data_for_TXT(self, _type, records):
values = []
for record in records:
values.append(record[0].decode('unicode-escape'))
try:
ttl = records[0][1]
except IndexError:
ttl = self.default_ttl
return {
'ttl': ttl,
'type': _type,
'values': values,
}
def _data_for_CNAME(self, _type, records):
first = records[0]
try:
@ -104,6 +120,7 @@ class TinyDnsBaseSource(BaseSource):
'C': 'CNAME',
'+': 'A',
'@': 'MX',
'\'': 'TXT',
}
name_re = re.compile(r'((?P<name>.+)\.)?{}$'.format(zone.name[:-1]))


Loading…
Cancel
Save