tcp_debug: don't abort when socket can't be removed

It appears that during some error conditions, the socket will not be in the tcp
socket debug tracking list, and on top of an exception this barfs as well.
Let's not care about the tcp debug list and avoid confusing error messages.

Change-Id: I8daa317fed8fc7e720dccb70fd5f7fc74fde423f
This commit is contained in:
Neels Hofmeyr 2017-02-27 01:17:22 +01:00
parent e349320992
commit 8e9f30f3e1
1 changed files with 4 additions and 1 deletions

View File

@ -74,7 +74,10 @@ class VTYInteract(object):
return
if debug_tcp_sockets:
VTYInteract.all_sockets.remove(self.socket)
try:
VTYInteract.all_sockets.remove(self.socket)
except ValueError:
pass
print "Socket: closing %s:%d %r (%d sockets open)" % (
self.host, self.port, self.socket,
len(VTYInteract.all_sockets))