Use errno

This commit is contained in:
Mike Place 2016-06-08 11:26:48 -06:00
parent e7de99dd0e
commit 2c88e22c07

View file

@ -17,6 +17,7 @@ import weakref
import urlparse # TODO: remove
import time
import traceback
import errno
# Import Salt Libs
import salt.crypt
@ -435,7 +436,7 @@ class TCPReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin, salt.tra
try:
self._socket.shutdown(socket.SHUT_RDWR)
except socket.error as exc:
if exc.errno == 107:
if exc.errno == errno.ENOTCONN:
# We may try to shutdown a socket which is already disconnected.
# Ignore this condition and continue.
pass