From e1e5d874ba7189f19e19e161f82be08d642ad010 Mon Sep 17 00:00:00 2001 From: Jeremy McMillan Date: Sat, 5 Jan 2019 21:17:41 -0600 Subject: [PATCH] checking for truthiness better than len --- salt/utils/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/utils/network.py b/salt/utils/network.py index 9d93596759..b87b11469a 100644 --- a/salt/utils/network.py +++ b/salt/utils/network.py @@ -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