def check_mod_enabled(mod):
 if (mod.endswith('.load') or mod.endswith('.conf')):
  mod_name = mod[:(-5)]
 else:
  mod_name = mod
 cmd = 'a2enmod -l'
 try:
  active_mods = __salt__['cmd.run'](cmd, python_shell=False).split(' ')
 except Exception as e:
  return e
 return (mod_name in active_mods)

def check_mod_enabled ( mod ) : if ( mod . endswith ( '.load' ) or mod . endswith ( '.conf' ) ) : mod_name = mod [ : ( - 5 ) ] else : mod_name = mod cmd = 'a2enmod -l' try : active_mods = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . split ( ' ' ) except Exception as e : return e return ( mod_name in active_mods )
checks to see if the specific mod symlink is in /etc/apache2/mods-enabled .