#NEWLINE# def act( self ) : #NEWLINE# #INDENT# workerName = self . get ( Engine . NAME , '' ) #NEWLINE# if ( workerName not in admin . workers ) : #NEWLINE# #INDENT# engine = monkapi . load_engine ( self ) #NEWLINE# if ( not engine ) : #NEWLINE# #INDENT# logger . info ( 'worker {} not registered' . format ( workerName ) ) #NEWLINE# return #NEWLINE# #UNINDENT# admin . workers [ workerName ] = engine #NEWLINE# logger . debug ( 'workers {}' . format ( admin . workers . keys ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# engine = admin . workers [ workerName ] #NEWLINE# #UNINDENT# engine . _setattr ( Engine . FADDRESS , self . get ( Engine . FADDRESS ) ) #NEWLINE# engine . _setattr ( Engine . FPID , self . get ( Engine . FPID ) ) #NEWLINE# engine . _setattr ( Engine . FSTATUS , cons . STATUS_ACTIVE ) #NEWLINE# engine . save ( )