#NEWLINE# def check_status( self , simulation ) : #NEWLINE# #INDENT# '\n    Check whether the actual status of the controller coincides with self.state\n    Returns a message entailing the details of the status\n    ' #NEWLINE# if ( self . state == ControllerState . DEAD ) : #NEWLINE# #INDENT# return ( True , 'OK' ) #NEWLINE# #UNINDENT# if ( not self . process ) : #NEWLINE# #INDENT# return ( False , ( 'Controller %s: Alive, but no controller process found' % self . cid ) ) #NEWLINE# #UNINDENT# rc = self . process . poll ( ) #NEWLINE# if ( rc is not None ) : #NEWLINE# #INDENT# return ( False , ( 'Controller %s: Alive, but controller process terminated with return code %d' % ( self . cid , rc ) ) ) #NEWLINE# #UNINDENT# return ( True , 'OK' )