Added compatibility for legacy configs

This commit is contained in:
Timothy Miller 2022-07-31 03:06:08 -04:00
parent 566ad3a7cf
commit 6933cbe27f

View File

@ -106,7 +106,12 @@ def commitRecord(ip):
return
base_domain_name = response["result"]["name"]
for subdomain in subdomains:
name = subdomain["name"].lower().strip()
try:
name = subdomain["name"].lower().strip()
proxied = subdomain["proxied"]
except:
name = subdomain
proxied = config["proxied"]
fqdn = base_domain_name
# Check if name provided is a reference to the root domain
if name != '' and name != '*' and name != '@':
@ -115,7 +120,7 @@ def commitRecord(ip):
"type": ip["type"],
"name": fqdn,
"content": ip["ip"],
"proxied": subdomain["proxied"],
"proxied": proxied,
"ttl": ttl
}
dns_records = cf_api(