code: def _check_avail(cmd):
      '''
      Check to see if the given command can be run
      '''
      if isinstance(cmd, list):
          cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x
                          for x in cmd])
      bret = True
      wret = False
      if __salt__['config.get']('cmd_blacklist_glob'):
          blist = __salt__['config.get']('cmd_blacklist_glob', [])
          for comp in blist:
              if fnmatch.fnmatch(cmd, comp):
                  # BAD! you are blacklisted
                  bret = False
      if __salt__['config.get']('cmd_whitelist_glob', []):
          blist = __salt__['config.get']('cmd_whitelist_glob', [])
          for comp in blist:
              if fnmatch.fnmatch(cmd, comp):
                  # GOOD! You are whitelisted
                  wret = True
                  break
      else:
          # If no whitelist set then alls good!
          wret = True
      return bret and wref _check_avail(cmd):
      '''
      Check to see if the given command can be run
      '''
      if isinstance(cmd, list):
          cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x
                          for x in cmd])
      bret = True
      wret = False
      if __salt__['config.get']('cmd_blacklist_glob'):
          blist = __salt__['config.get']('cmd_blacklist_glob', [])
          for comp in blist:
              if fnmatch.fnmatch(cmd, comp):
                  # BAD! you are blacklisted
                  bret = False
      if __salt__['config.get']('cmd_whitelist_glob', []):
          blist = __salt__['config.get']('cmd_whitelist_glob', [])
          for comp in blist:
              if fnmatch.fnmatch(cmd, comp):
                  # GOOD! You are whitelisted
                  wret = True
                  break
      else:
          # If no whitelist set then alls good!
          wret = True
      return bret and wret
docs: Check to see if the given command can be run