zephyr: Fix compute_mit_user_fullname for py3dns returning bytes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-02-25 10:12:06 -08:00
committed by Tim Abbott
parent 766467c5e3
commit 498c6c485e
5 changed files with 10 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ def compute_mit_user_fullname(email: str) -> str:
match_user = re.match(r"^([a-zA-Z0-9_.-]+)(\|.+)?@mit\.edu$", email.lower())
if match_user and match_user.group(2) is None:
answer = DNS.dnslookup(f"{match_user.group(1)}.passwd.ns.athena.mit.edu", DNS.Type.TXT)
hesiod_name = answer[0][0].split(":")[4].split(",")[0].strip()
hesiod_name = answer[0][0].decode().split(":")[4].split(",")[0].strip()
if hesiod_name != "":
return hesiod_name
elif match_user: