still fiddling

This commit is contained in:
brent s. 2020-05-10 08:48:08 -04:00
parent b638e58dc8
commit b2848970c3
Signed by: bts
GPG Key ID: 8C004C2F93481F6B

View File

@ -252,9 +252,9 @@ class Updater(object):
# update.
logger.debug('Record {0} ({1}) exists but does not contain {2}; replacing'.format(fqdn, t, ip))
for r_id in r_ids:
del_url = '{0}/domains/{1}/records/{1}'.format(self.api_base, d_id, r_id)
del_url = '{0}/{1}'.format(records_url, r_id)
logger.debug(('Deleting record ID {0} for {1} ({2})').format(r_id, fqdn, t))
del_r = self.session.delete(records_url)
del_r = self.session.delete(del_url)
if not del_r.ok:
e = 'Could not delete record ID {0} for {1} ({2}); skipping'.format(r_id, fqdn, t)
if is_tty:
@ -268,8 +268,7 @@ class Updater(object):
'type': t,
'target': ip,
'ttl_sec': 300}
create_url = '{0}/domains/{1}/records'.format(self.api_base, d_id)
create_r = self.session.post(create_url,
create_r = self.session.post(records_url,
json = record)
if not create_r.ok:
e = 'Could not create record {0} ({1}); skipping'.format(fqdn, t)