From 3c6829826fa60496e9ef15522072fea2932c665b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 12 Dec 2023 14:51:38 +1100 Subject: [PATCH] fix: Stop duplicating A and TLSA records and fix alts --- varo.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/varo.py b/varo.py index e602627..aa29054 100644 --- a/varo.py +++ b/varo.py @@ -204,7 +204,7 @@ def verify_ALIAS(domain): "action": "getRecords", "zone": zone, "name": domain+"."+city_domain, - "type": "ALIAS", + "type": "A", "content": "" } url = "https://reg.woodburn.au/api" @@ -281,16 +281,15 @@ def copy_to_alts(domain): } r = requests.post(url, headers=headers, json=data) r = r.json() - if 'data' not in r: - continue - for record in r['data']: - data = { - "action": "deleteRecord", - "zone": alt_zone, - "record": record['uuid'] - } - r = requests.post(url, headers=headers, json=data) - print(r.text) + if 'data' in r: + for record in r['data']: + data = { + "action": "deleteRecord", + "zone": alt_zone, + "record": record['uuid'] + } + r = requests.post(url, headers=headers, json=data) + print(r.text) # Add each record to each alt for record in records: