#NEWLINE# def _report_state( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# devices = len ( self . mgr . get_all_devices ( ) ) #NEWLINE# self . agent_state . get ( 'configurations' ) [ 'devices' ] = devices #NEWLINE# agent_status = self . state_rpc . report_state ( self . context , self . agent_state , True ) #NEWLINE# if ( agent_status == n_const . AGENT_REVIVED ) : #NEWLINE# #INDENT# LOG . info ( _LI ( '%s Agent has just been revived. Doing a full sync.' ) , self . agent_type ) #NEWLINE# self . fullsync = True #NEWLINE# #UNINDENT# self . agent_state . pop ( 'resource_versions' , None ) #NEWLINE# self . agent_state . pop ( 'start_flag' , None ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# LOG . exception ( _LE ( 'Failed reporting state!' ) )