TXT records from metadata work now!

This commit is contained in:
Kalzu Rekku 2025-05-03 15:10:39 +03:00
parent cb2beade61
commit ad449d5ac2

View File

@ -1173,21 +1173,14 @@ class MiniDiscoveryResolver(common.ResolverBase):
f"DNS TXT: Attempting to create Record_TXT for instance {instance_id_str} with {num_segments} segments..." f"DNS TXT: Attempting to create Record_TXT for instance {instance_id_str} with {num_segments} segments..."
) )
# **** THE KEY WORKAROUND **** # Instantiate Record_TXT by unpacking the list of segments
if num_segments == 1: payload = dns.Record_TXT(
# If only one segment, pass the bytes object directly *final_txt_payload_segments, ttl=DNS_DEFAULT_TTL
payload_data = final_txt_payload_segments[0] )
print(" (Payload is single segment, passing bytes directly)") print(
else: f" (Payload has {num_segments} segments, unpacked and passed to Record_TXT)"
# If multiple segments, pass the list (MUST use list/tuple here) )
payload_data = final_txt_payload_segments # Pass the list
print(
f" (Payload has {num_segments} segments, passing sequence)"
)
# **** END WORKAROUND ****
# Instantiate Record_TXT with the correctly structured data
payload = dns.Record_TXT(payload_data, ttl=DNS_DEFAULT_TTL)
print( print(
f"DNS TXT: Record_TXT created successfully for {instance_id_str}." f"DNS TXT: Record_TXT created successfully for {instance_id_str}."
) )