1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Add warn for unparsable dynamic records

This commit is contained in:
Viranch Mehta
2021-10-22 13:13:05 -07:00
parent 3bbbb4136c
commit 7cd98591f4

View File

@@ -780,11 +780,15 @@ class Ns1Provider(BaseProvider):
if 'pool:' in first_answer_note:
return self._data_for_dynamic(_type, record)
# If not, it can't be parsed. Let it be an empty record
try:
value = record['short_answers'][0]
except (IndexError, KeyError):
self.log.warn('Cannot parse %s dynamic record due to missing '
'pool name in first answer note, treating it as '
'an empty record', record['domain'])
value = None
else:
try:
value = record['short_answers'][0]
except IndexError:
value = None
return {
'ttl': record['ttl'],