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

Fix deletion of Cloudflare ALIAS reocrds

This commit is contained in:
Ross McFarland
2018-12-09 14:24:53 -08:00
parent b83572c0b9
commit f52005bf60

View File

@@ -524,9 +524,12 @@ class CloudflareProvider(BaseProvider):
def _apply_Delete(self, change):
existing = change.existing
existing_name = existing.fqdn[:-1]
# Make sure to map ALIAS to CNAME when looking for the target to delete
existing_type = 'CNAME' if existing._type == 'ALIAS' \
else existing._type
for record in self.zone_records(existing.zone):
if existing_name == record['name'] and \
existing._type == record['type']:
existing_type == record['type']:
path = '/zones/{}/dns_records/{}'.format(record['zone_id'],
record['id'])
self._request('DELETE', path)