3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

relay: use the "official" method of removing bad networks

This commit is contained in:
James Lu 2016-07-13 18:49:51 -07:00
parent 31bf984996
commit 5c7524bcf3

View File

@ -7,6 +7,7 @@ from collections import defaultdict
from pylinkirc import utils, world, conf
from pylinkirc.log import log
from pylinkirc.coremods import control
### GLOBAL (statekeeping) VARIABLES
relayusers = defaultdict(dict)
@ -248,9 +249,8 @@ def spawnRelayServer(irc, remoteirc):
log.exception('(%s) Failed to spawn server for %r:',
irc.name, remoteirc.name)
# We will just bail here. Disconnect the bad network.
handle_disconnect(irc, None, 'PYLINK_DISCONNECT_RELAY_FORCED', {})
irc.disconnect()
raise
control.remove_network(irc)
return
# Mark the server as a relay server
irc.servers[sid].remote = remoteirc.name