#NEWLINE# def shutdown( delay = 0 , message = None ) : #NEWLINE# #INDENT# '\n    Shutdown a running system\n\n    delay : int\n        Optional wait time in seconds before the system will be shutdown.\n    message : string\n        Optional message to broadcast before rebooting.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt \'*\' system.shutdown\n        salt \'*\' system.shutdown 60 "=== disk replacement ==="\n    ' #NEWLINE# cmd = [ 'shutdown' , '-i' , '5' , '-g' , delay , '-y' ] #NEWLINE# if ret : #NEWLINE# #INDENT# cmd . append ( message ) #NEWLINE# #UNINDENT# ret = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) #NEWLINE# return ret