#NEWLINE# def _validate_power_state( self , node_uuid , power_state ) : #NEWLINE# #INDENT# if ( power_state == 'rebooting' ) : #NEWLINE# #INDENT# power_state = 'power on' #NEWLINE# #UNINDENT# start = timeutils . utcnow ( ) #NEWLINE# while ( timeutils . delta_seconds ( start , timeutils . utcnow ( ) ) < self . power_timeout ) : #NEWLINE# #INDENT# ( _ , node ) = self . client . show_node ( node_uuid ) #NEWLINE# if ( node [ 'power_state' ] == power_state ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# message = ( 'Failed to set power state within the required time: %s sec.' % message . power_timeout ) #NEWLINE# raise exceptions . TimeoutException ( message )