mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix wart in network util method
This commit is contained in:
parent
31c59ce450
commit
353a9c32fa
1 changed files with 3 additions and 2 deletions
|
@ -2241,7 +2241,7 @@ def _test_addrs(addrinfo, port):
|
|||
if ip_addr in ip_addrs:
|
||||
continue
|
||||
ip_addrs.append(ip_addr)
|
||||
|
||||
s = None
|
||||
try:
|
||||
s = socket.socket(ip_family, socket.SOCK_STREAM)
|
||||
s.settimeout(2)
|
||||
|
@ -2251,7 +2251,8 @@ def _test_addrs(addrinfo, port):
|
|||
except OSError:
|
||||
pass
|
||||
finally:
|
||||
s.close()
|
||||
if s is not None:
|
||||
s.close()
|
||||
return ip_addrs
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue