fix issues raising pylint warnings
+ small bug fixes Change-Id: Ib63bf13ad06446d3ec3b8cd0b16f9426cef9e3f4
This commit is contained in:
@ -26,6 +26,7 @@ import socketserver
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import errno
|
||||
|
||||
from secop.datatypes import BoolType, StringType
|
||||
from secop.errors import SECoPError
|
||||
@ -192,9 +193,9 @@ class TCPServer(socketserver.ThreadingTCPServer):
|
||||
self, ('0.0.0.0', port), TCPRequestHandler, bind_and_activate=True)
|
||||
break
|
||||
except OSError as e:
|
||||
if e.args[0] == 98: # address already in use
|
||||
if e.args[0] == errno.EADDRINUSE: # address already in use
|
||||
# this may happen despite of allow_reuse_address
|
||||
time.sleep(0.3 * (1 << ntry))
|
||||
time.sleep(0.3 * (1 << ntry)) # max accumulated sleep time: 0.3 * 31 = 9.3 sec
|
||||
else:
|
||||
self.log.error('could not initialize TCP Server: %r' % e)
|
||||
raise
|
||||
|
Reference in New Issue
Block a user