#NEWLINE# @ Text ( 'announce eor' ) #NEWLINE# def announce_eor( self , reactor , service , command ) : #NEWLINE# #INDENT# def callback( self , command , peers ) : #NEWLINE# #INDENT# family = self . parser . api_eor ( command ) #NEWLINE# if ( not family ) : #NEWLINE# #INDENT# self . log_failure ( ( 'Command could not parse eor : %s' % command ) ) #NEWLINE# reactor . answer ( service , 'error' ) #NEWLINE# ( yield True ) #NEWLINE# return #NEWLINE# #UNINDENT# reactor . configuration . inject_eor ( peers , family ) #NEWLINE# self . log_message ( ( 'Sent to %s : %s' % ( ( ', ' . join ( ( peers if peers else [ ] ) ) if ( peers is not None ) else 'all peers' ) , family . extensive ( ) ) ) ) #NEWLINE# ( yield False ) #NEWLINE# reactor . route_update = True #NEWLINE# reactor . answer ( service , 'done' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( descriptions , command ) = self . parser . extract_neighbors ( command ) #NEWLINE# peers = reactor . match_neighbors ( descriptions ) #NEWLINE# if ( not peers ) : #NEWLINE# #INDENT# self . log_failure ( ( 'no neighbor matching the command : %s' % command ) , 'warning' ) #NEWLINE# reactor . answer ( service , 'error' ) #NEWLINE# return False #NEWLINE# #UNINDENT# reactor . plan ( callback ( self , command , peers ) , 'announce_eor' ) #NEWLINE# return True #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# self . log_failure ( 'issue parsing the command' ) #NEWLINE# reactor . answer ( service , 'error' ) #NEWLINE# return False #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# self . log_failure ( 'issue parsing the command' ) #NEWLINE# reactor . answer ( service , 'error' ) #NEWLINE# return False