Description: Fix for iptables --help issue (upstream issue 13527)
Origin: https://github.com/saltstack/salt/blob/24658e42/salt/modules/iptables.py

--- a/salt/modules/iptables.py
+++ b/salt/modules/iptables.py
@@ -13,20 +13,16 @@
 from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS
 from salt.exceptions import SaltException
 import salt.modules.cmdmod as salt_cmd
-HAS_CHECK = False
 
 
 def __virtual__():
     '''
     Only load the module if iptables is installed
     '''
-    global HAS_CHECK
-    if salt_cmd.run('iptables --help').find('--check'):
-        HAS_CHECK = True
+    if not salt.utils.which('iptables'):
+        return False
 
-    if salt.utils.which('iptables'):
-        return True
-    return False
+    return True
 
 
 def _iptables_cmd(family='ipv4'):
@@ -382,6 +378,10 @@
     if not rule:
         return 'Error: Rule needs to be specified'
 
+    HAS_CHECK = False
+    if '--check' in salt_cmd.run('iptables --help', output_loglevel='quiet'):
+        HAS_CHECK = True
+
     if HAS_CHECK is False:
         cmd = '{0}-save' . format(_iptables_cmd(family))
         out = __salt__['cmd.run'](cmd).find('-A {1} {2}'.format(
