#NEWLINE# def set_autostart( vm_ , state = 'on' ) : #NEWLINE# #INDENT# '\n    Set the autostart flag on a VM so that the VM will start with the host\n    system on reboot.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt "*" virt.set_autostart <domain> <on | off>\n    ' #NEWLINE# dom = _get_domain ( vm_ ) #NEWLINE# if ( state == 'on' ) : #NEWLINE# #INDENT# return ( dom . setAutostart ( 1 ) == 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( state == 'off' ) : #NEWLINE# #INDENT# return ( dom . setAutostart ( 0 ) == 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False