mirror of https://github.com/zulip/zulip.git
Fix broken parsing of DNS response.
(imported from commit 3a627d45bc313bf244dc699a59df9423c849bc35)
This commit is contained in:
parent
ad10cecdd7
commit
3129b6374d
|
@ -168,11 +168,13 @@ def compute_mit_user_fullname(email):
|
|||
answer = DNS.dnslookup(
|
||||
"%s.passwd.ns.athena.mit.edu" % (match_user.group(1),),
|
||||
DNS.Type.TXT)
|
||||
hesiod_name = answer[0].split(':')[4].split(',')[0].strip()
|
||||
hesiod_name = answer[0][0].split(':')[4].split(',')[0].strip()
|
||||
if hesiod_name != "":
|
||||
return hesiod_name
|
||||
elif match_user:
|
||||
return match_user.group(1).lower() + "@" + match_user.group(2).upper()[1:]
|
||||
except DNS.Base.ServerError:
|
||||
pass
|
||||
except:
|
||||
print ("Error getting fullname for %s:" % (email,))
|
||||
traceback.print_exc()
|
||||
|
|
Loading…
Reference in New Issue