#NEWLINE# def restart_instance( self , instance ) : #NEWLINE# #INDENT# nova = self . nova_client #NEWLINE# logger . debug ( 'About to restart instance %s' , instance . uuid ) #NEWLINE# try : #NEWLINE# #INDENT# nova . servers . reboot ( instance . backend_id ) #NEWLINE# if ( not self . _wait_for_instance_status ( instance . backend_id , nova , 'ACTIVE' , retries = 80 ) ) : #NEWLINE# #INDENT# logger . error ( 'Failed to restart instance %s' , instance . uuid ) #NEWLINE# raise OpenStackBackendError ( ( 'Timed out waiting for instance %s to restart' % instance . uuid ) ) #NEWLINE# #UNINDENT# #UNINDENT# except nova_exceptions . ClientException as e : #NEWLINE# #INDENT# logger . exception ( 'Failed to restart instance %s' , instance . uuid ) #NEWLINE# six . reraise ( OpenStackBackendError , e ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( 'Successfully restarted instance %s' , instance . uuid )