Fixed incorrect method invokation

This commit is contained in:
2021-12-21 14:59:56 +00:00
parent cab6aff3ef
commit 1d4ae4e88e

View File

@ -22,13 +22,6 @@ domain = os.environ['CERTBOT_DOMAIN']
SUBDOMAIN = '_acme-challenge' SUBDOMAIN = '_acme-challenge'
LIVEDNS_API_URL = 'https://api.gandi.net/v5/livedns/domains' LIVEDNS_API_URL = 'https://api.gandi.net/v5/livedns/domains'
response = requests.get(LIVEDNS_API_URL + '/' + domain + '/' +
'records' + '/' + SUBDOMAIN, headers=headers)
#if len(response.json()) > 0 and 'rrset_type' in response.json()[0]:
# logger.warning('Warning! Stale authentication token found!')
# delete_dns_record(SUBDOMAIN, domain)
# Create a new TXT record from scratch # Create a new TXT record from scratch
record = { record = {
"rrset_name": SUBDOMAIN, "rrset_name": SUBDOMAIN,
@ -42,7 +35,7 @@ response = requests.post(LIVEDNS_API_URL + '/' + domain
if not response.ok: if not response.ok:
logger.error('Could not create proper DNS record for LETSENCRYPT') logger.error('Could not create proper DNS record for LETSENCRYPT')
logger.error(response.raise_for_status) logger.error(response.raise_for_status())
exit(1) exit(1)
time.sleep(30) time.sleep(30)