mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
checking for truthiness better than len
This commit is contained in:
parent
a984a43995
commit
e1e5d874ba
@ -1899,7 +1899,7 @@ def dns_check(addr, port, safe=False, ipv6=None):
|
||||
except socket.error:
|
||||
pass
|
||||
if not resolved:
|
||||
if len(candidates) > 0:
|
||||
if candidates:
|
||||
resolved = candidates[0]
|
||||
else:
|
||||
error = True
|
||||
|
Loading…
Reference in New Issue
Block a user