use a split method on the string, instead of a regex, to make getting the host and domain easier when deleting a record

This commit is contained in:
Jeffrey Forman 2012-12-15 20:21:07 -05:00
parent acd9ec596c
commit 16a629f81a
1 changed files with 3 additions and 3 deletions

View File

@ -91,9 +91,9 @@ def delete_record(dns_server, rr_list, key_name):
delete_response = []
for current_rr in rr_list:
re_record = re.search(r"(\w+)\.(.*)$", current_rr)
record = re_record.group(1)
domain = re_record.group(2)
record_list = current_rr.split(".")
record = record_list[0]
domain = ".".join(record_list[1:])
dns_update = dns.update.Update(domain, keyring = keyring)
dns_update.delete(record)
output = send_dns_update(dns_update, dns_server, key_name)