Browse Source

fix: prevent digital ocean provider to crash if records type is not supported

pull/364/head
ItsAlex 7 years ago
parent
commit
53c2b8d194
No known key found for this signature in database GPG Key ID: D13067073B9A98A9
2 changed files with 15 additions and 0 deletions
  1. +4
    -0
      octodns/provider/digitalocean.py
  2. +11
    -0
      tests/fixtures/digitalocean-page-1.json

+ 4
- 0
octodns/provider/digitalocean.py View File

@ -223,6 +223,10 @@ class DigitalOceanProvider(BaseProvider):
values = defaultdict(lambda: defaultdict(list))
for record in self.zone_records(zone):
_type = record['type']
if _type not in self.SUPPORTS:
self.log.warning('populate: skipping unsupported %s record',
_type)
continue
values[record['name']][record['type']].append(record)
before = len(zone.records)


+ 11
- 0
tests/fixtures/digitalocean-page-1.json View File

@ -1,5 +1,16 @@
{
"domain_records": [{
"id": null,
"type": "SOA",
"name": "@",
"data": null,
"priority": null,
"port": null,
"ttl": null,
"weight": null,
"flags": null,
"tag": null
}, {
"id": 11189874,
"type": "NS",
"name": "@",


Loading…
Cancel
Save