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

Corrected handling of ns1 errors, Ns1Provider.populate tests

This commit is contained in:
Ross McFarland
2017-05-22 17:33:31 -07:00
parent 23257d8ac7
commit 06e17d043b
2 changed files with 183 additions and 3 deletions

View File

@@ -111,11 +111,14 @@ class Ns1Provider(BaseProvider):
try:
nsone_zone = self._client.loadZone(zone.name[:-1])
except ResourceException:
return
records = nsone_zone.data['records']
except ResourceException as e:
if e.message != 'server error: zone not found':
raise
records = []
before = len(zone.records)
for record in nsone_zone.data['records']:
for record in records:
_type = record['type']
data_for = getattr(self, '_data_for_{}'.format(_type))
name = zone.hostname_from_fqdn(record['domain'])