Browse Source

Fixes for cloudflare CAA support

pull/105/head
Ross McFarland 8 years ago
parent
commit
a558fde6df
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
2 changed files with 12 additions and 11 deletions
  1. +7
    -8
      octodns/provider/cloudflare.py
  2. +5
    -3
      tests/fixtures/cloudflare-dns_records-page-2.json

+ 7
- 8
octodns/provider/cloudflare.py View File

@ -107,11 +107,8 @@ class CloudflareProvider(BaseProvider):
def _data_for_CAA(self, _type, records):
values = []
for r in records:
values.append({
'flags': r['flags'],
'tag': r['tag'],
'value': r['content'],
})
data = r['data']
values.append(data)
return {
'ttl': records[0]['ttl'],
'type': _type,
@ -214,9 +211,11 @@ class CloudflareProvider(BaseProvider):
def _contents_for_CAA(self, record):
for value in record.values:
yield {
'flags': value.flags,
'tag': value.tag,
'value': value.value,
'data': {
'flags': value.flags,
'tag': value.tag,
'value': value.value,
}
}
def _contents_for_TXT(self, record):


+ 5
- 3
tests/fixtures/cloudflare-dns_records-page-2.json View File

@ -123,9 +123,11 @@
"id": "fc223b34cd5611334422ab3322997667",
"type": "CAA",
"name": "unit.tests",
"content": "ca.unit.tests",
"flags": 0,
"tag": "issue",
"data": {
"flags": 0,
"tag": "issue",
"value": "ca.unit.tests"
},
"proxiable": false,
"proxied": false,
"ttl": 3600,


Loading…
Cancel
Save