|
|
@ -190,11 +190,13 @@ class Ns1Provider(BaseProvider): |
|
|
nsone_zone = self._client.loadZone(zone.name[:-1]) |
|
|
nsone_zone = self._client.loadZone(zone.name[:-1]) |
|
|
records = nsone_zone.data['records'] |
|
|
records = nsone_zone.data['records'] |
|
|
geo_records = nsone_zone.search(has_geo=True) |
|
|
geo_records = nsone_zone.search(has_geo=True) |
|
|
|
|
|
exists = True |
|
|
except ResourceException as e: |
|
|
except ResourceException as e: |
|
|
if e.message != self.ZONE_NOT_FOUND_MESSAGE: |
|
|
if e.message != self.ZONE_NOT_FOUND_MESSAGE: |
|
|
raise |
|
|
raise |
|
|
records = [] |
|
|
records = [] |
|
|
geo_records = [] |
|
|
geo_records = [] |
|
|
|
|
|
exists = False |
|
|
|
|
|
|
|
|
before = len(zone.records) |
|
|
before = len(zone.records) |
|
|
# geo information isn't returned from the main endpoint, so we need |
|
|
# geo information isn't returned from the main endpoint, so we need |
|
|
@ -208,8 +210,9 @@ class Ns1Provider(BaseProvider): |
|
|
source=self, lenient=lenient) |
|
|
source=self, lenient=lenient) |
|
|
zone_hash[(_type, name)] = record |
|
|
zone_hash[(_type, name)] = record |
|
|
[zone.add_record(r) for r in zone_hash.values()] |
|
|
[zone.add_record(r) for r in zone_hash.values()] |
|
|
self.log.info('populate: found %s records', |
|
|
|
|
|
len(zone.records) - before) |
|
|
|
|
|
|
|
|
self.log.info('populate: found %s records, exists=%s', |
|
|
|
|
|
len(zone.records) - before, exists) |
|
|
|
|
|
return exists |
|
|
|
|
|
|
|
|
def _params_for_A(self, record): |
|
|
def _params_for_A(self, record): |
|
|
params = {'answers': record.values, 'ttl': record.ttl} |
|
|
params = {'answers': record.values, 'ttl': record.ttl} |
|
|
|