Doesn't fail if host has NO SRV record

Just catch an other exception type coming from the dns resolver that
could be raised with hosts like "anon.example.com" which just don't have
any SRV record.
This commit is contained in:
Florent Le Coz
2010-11-08 09:14:17 +08:00
committed by Lance Stout
parent 4fb77ac878
commit 9dbf246f0b
3 changed files with 2 additions and 11 deletions

View File

@@ -164,7 +164,7 @@ class ClientXMPP(BaseXMPP):
try:
xmpp_srv = "_xmpp-client._tcp.%s" % self.server
answers = dns.resolver.query(xmpp_srv, dns.rdatatype.SRV)
except dns.resolver.NXDOMAIN:
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
log.debug("No appropriate SRV record found." + \
" Using JID server name.")
else: