diff --git a/salt/cli/salt.py b/salt/cli/salt.py
index <HASH>..<HASH> 100644
--- a/salt/cli/salt.py
+++ b/salt/cli/salt.py
@@ -210,7 +210,7 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser):
             # returned 'ok' with a retcode of 0.
             # This is the final point before the 'salt' cmd returns,
             # which is why we set the retcode here.
-            if retcodes.count(0) < len(retcodes):
+            if not all(exit_code == 0 for exit_code in retcodes):
                 sys.stderr.write('ERROR: Minions returned with non-zero exit code\n')
                 sys.exit(11)
Don't iterate through retcodes twice

This use a generator comprehension to stop iteration as soon as a
nonzero retcode is found.