Bugfix: target field of SRV object should be casted to string

This commit is contained in:
Alexander Kukushkin
2015-06-09 15:46:34 +02:00
parent 57914821d0
commit a64dad267e
+1 -1
View File
@@ -82,7 +82,7 @@ class Client:
@staticmethod
def get_srv_record(host):
try:
return [(r.target.rstrip('.'), r.port) for r in resolver.query('_etcd-server._tcp.' + host, 'SRV')]
return [(str(r.target).rstrip('.'), r.port) for r in resolver.query('_etcd-server._tcp.' + host, 'SRV')]
except DNSException:
logger.exception('Can not resolve SRV for %s', host)
return []