remove last dot (which is RFC possiblity) the dnspython way. thank Bob Halley

This commit is contained in:
Nikos Kouremenos 2005-12-06 22:08:10 +00:00
parent eae33b3677
commit 9e85df37b1
1 changed files with 101 additions and 102 deletions

View File

@ -1584,10 +1584,9 @@ class Connection:
answers = [x for x in dns.resolver.query(query, 'SRV')]
if answers:
for a in answers:
target = str(a.target)
if target.endswith('.'):
target = dns.name.from_text(str(a.target))
# target is f.e. talk.google.com. remove last dot
target = target[:-1]
target = target.to_text(omit_final_dot = True)
hosts.append({'host': target,
'port': int(a.port),
'prio': int(a.priority),