handle server names with embeded ports

This commit is contained in:
Mark Haines 2014-11-03 16:08:22 +00:00
parent 2221a13a4d
commit fe6832fae8

View File

@ -15,6 +15,10 @@ import argparse
import logging import logging
def get_targets(server_name): def get_targets(server_name):
if ":" in server_name:
target, port = server_name.split(":")
yield (target, int(port))
return
try: try:
answers = dns.resolver.query("_matrix._tcp." + server_name, "SRV") answers = dns.resolver.query("_matrix._tcp." + server_name, "SRV")
for srv in answers: for srv in answers: