Check and format TXT-data

This commit is contained in:
otthorn 2021-04-15 01:55:52 +02:00
parent aa777a3e61
commit 80ae6c7760

8
lib.py
View file

@ -238,10 +238,16 @@ def txt_records_handler(re2o_zone, dns_zone):
else:
name_obj = format_re2o_domain(name)
txt_data = record["field2"]
if txt_data[0] == '"' and txt_data[-1] == '"':
txt_data = txt_data[1:-1]
logging.debug(f"TXT-DATA = {txt_data}")
TXT_obj = TXT.TXT(
dns.rdataclass.IN,
dns.rdatatype.TXT,
record["field2"]
txt_data
)
add_to_zone(dns_zone, name_obj, TXT_obj)