(config, hostname)
| 89 | |
| 90 | @retry(stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000) |
| 91 | def delete_dns(config, hostname): |
| 92 | cf = CloudFlare.CloudFlare(debug=False, token=get_env("DNS_API_TOKEN")) |
| 93 | zone_tag = config["zone_tag"] |
| 94 | dns_records = cf.zones.dns_records.get(zone_tag, params={'name': hostname}) |
| 95 | if len(dns_records) > 0: |
| 96 | cf.zones.dns_records.delete(zone_tag, dns_records[0]['id']) |
| 97 | |
| 98 | |
| 99 | def write_file(content, path): |