2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Handle unresolvable switches gracecfully

Rather than a trace log,
keep it to only the event log.
This commit is contained in:
Jarrod Johnson 2020-09-02 11:50:50 -04:00
parent 46396247bb
commit 5e01d9c97b

View File

@ -32,6 +32,7 @@
# This functionality is restricted to the null tenant
from confluent.networking.lldp import _handle_neighbor_query, get_fingerprint
from confluent.networking.netutil import get_switchcreds, list_switches, get_portnamemap
import eventlet.green.socket as socket
if __name__ == '__main__':
import sys
@ -105,7 +106,7 @@ def _namesmatch(switchdesc, userdesc):
def _map_switch(args):
try:
return _map_switch_backend(args)
except UnicodeError:
except (UnicodeError, socket.gaierror):
log.log({'error': "Cannot resolve switch '{0}' to an address".format(
args[0])})
except exc.TargetEndpointUnreachable: