def _check_avail(cmd):
 if isinstance(cmd, list):
  cmd = ' '.join([(str(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):
    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):
    wret = True
    break
 else:
  wret = True
 return (bret and wret)

def _check_avail ( cmd ) : if isinstance ( cmd , list ) : cmd = ' ' . join ( [ ( str ( 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 ) : 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 ) : wret = True break else : wret = True return ( bret and wret )
check to see if the given command can be run .