To be on the safe side, only include data attribute on record create
and update if it's not empty.
This way data will only be provided for SSHFP records.
@@ -329,10 +329,12 @@ class CloudFlareDNSDriver(DNSDriver):
body = {
'type': type,
'name': name,
- 'content': content,
- 'data': data
+ 'content': content
}
+ if data:
+ body['data'] = data
+
merge_valid_keys(body, RECORD_CREATE_ATTRIBUTES, extra)
self.connection.set_context({'zone_id': zone.id})
@@ -362,10 +364,12 @@ class CloudFlareDNSDriver(DNSDriver):
'type': record.type if type is None else type,
'name': record.name if name is None else name,
'content': content,
- 'data': data,
'extra': record.extra or {},
}
+ if data:
+ body['data'] = data
+
merge_valid_keys(body['extra'], RECORD_UPDATE_ATTRIBUTES, extra)
self.connection.set_context({'record_id': record.id})
