def _chkconfig_is_enabled(name, runlevel=None):
 cmdline = '/sbin/chkconfig --list {0}'.format(name)
 result = __salt__['cmd.run_all'](cmdline, python_shell=False)
 if (runlevel is None):
  runlevel = _runlevel()
 if (result['retcode'] == 0):
  for row in result['stdout'].splitlines():
   if ('{0}:on'.format(runlevel) in row):
    if (row.split()[0] == name):
     return True
   elif (row.split() == [name, 'on']):
    return True
 return False

def _chkconfig_is_enabled ( name , runlevel = None ) : cmdline = '/sbin/chkconfig --list {0}' . format ( name ) result = __salt__ [ 'cmd.run_all' ] ( cmdline , python_shell = False ) if ( runlevel is None ) : runlevel = _runlevel ( ) if ( result [ 'retcode' ] == 0 ) : for row in result [ 'stdout' ] . splitlines ( ) : if ( '{0}:on' . format ( runlevel ) in row ) : if ( row . split ( ) [ 0 ] == name ) : return True elif ( row . split ( ) == [ name , 'on' ] ) : return True return False
return true if the service is enabled according to chkconfig; otherwise return false .