mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Close open socket on freebsd
This commit is contained in:
parent
1923d16029
commit
b2a1779383
1 changed files with 5 additions and 2 deletions
|
@ -270,14 +270,17 @@ def get_unused_localhost_port():
|
|||
usock.close()
|
||||
return port
|
||||
|
||||
if sys.platform.startswith('darwin') and port in _RUNTESTS_PORTS:
|
||||
DARWIN = True if sys.platform.startswith('darwin') else False
|
||||
BSD = True if 'bsd' in sys.platform else False
|
||||
|
||||
if DARWIN and port in _RUNTESTS_PORTS:
|
||||
port = get_unused_localhost_port()
|
||||
usock.close()
|
||||
return port
|
||||
|
||||
_RUNTESTS_PORTS[port] = usock
|
||||
|
||||
if sys.platform.startswith('darwin'):
|
||||
if DARWIN or BSD:
|
||||
usock.close()
|
||||
|
||||
return port
|
||||
|
|
Loading…
Add table
Reference in a new issue