Skip to content

Commit

Permalink
Ignore getservbyport() OSError
Browse files Browse the repository at this point in the history
those mean the port/proto is not resolved. not important to us.
  • Loading branch information
cvaroqui committed May 23, 2018
1 parent 341986c commit d41d6c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/osvcd_dns.py
Expand Up @@ -427,8 +427,11 @@ def srv_records(self):
try:
serv = socket.getservbyport(port)
qnames.append("_%s._%s.%s.%s.svc.%s." % (serv, proto, _svcname, app, self.cluster_name))
except socket.error as exc:
except OSError as exc:
# port/proto not found
pass
except Exception as exc:
self.log.warning("port %d resolution failed: %s", port, exc)
target = "%s.%s.%s.svc.%s." % (self.unique_name(addr), _svcname, app, self.cluster_name)
content = "%(prio)d %(weight)d %(port)d %(target)s" % {
"prio": 0,
Expand Down

0 comments on commit d41d6c2

Please sign in to comment.