#NEWLINE# def signal( signal = None ) : #NEWLINE# #INDENT# "\n    Signals httpd to start, restart, or stop.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' apache.signal restart\n    " #NEWLINE# no_extra_args = ( 'configtest' , 'status' , 'fullstatus' ) #NEWLINE# valid_signals = ( 'start' , 'stop' , 'restart' , 'graceful' , 'graceful-stop' ) #NEWLINE# if ( ( signal not in valid_signals ) and ( signal not in no_extra_args ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( signal in valid_signals ) : #NEWLINE# #INDENT# arguments = ' -k {0}' . format ( signal ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# arguments = ' {0}' . format ( signal ) #NEWLINE# #UNINDENT# cmd = ( _detect_os ( ) + no_extra_args ) #NEWLINE# out = __salt__ [ 'cmd.run_all' ] ( cmd ) #NEWLINE# if ( out [ 'retcode' ] and out [ 'stderr' ] ) : #NEWLINE# #INDENT# ret = out [ 'stderr' ] . strip ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if out [ 'stderr' ] : #NEWLINE# #INDENT# ret = out [ 'stderr' ] . strip ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if out [ 'stdout' ] : #NEWLINE# #INDENT# ret = out [ 'stdout' ] . strip ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret = 'Command: "{0}" completed successfully!' . format ( cmd ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ret