#NEWLINE# def enabled( name , **kwargs ) : #NEWLINE# #INDENT# "\n    Return True if the named service is enabled, false otherwise\n\n    name\n        Service name\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' service.enabled <service name>\n    " #NEWLINE# if ( not available ( name ) ) : #NEWLINE# #INDENT# log . error ( 'Service {0} not found' . format ( name ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# cmd = '{0} {1} rcvar' . format ( _cmd ( ) , name ) #NEWLINE# for line in __salt__ [ 'cmd.run_stdout' ] ( cmd , python_shell = False ) . splitlines ( ) : #NEWLINE# #INDENT# if ( '_enable="' not in line ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( _ , state , _ ) = line . split ( '"' , 2 ) #NEWLINE# return ( state . lower ( ) in ( 'yes' , 'true' , 'on' , '1' ) ) #NEWLINE# #UNINDENT# return False