#NEWLINE# @ Text ( 'teardown' ) #NEWLINE# def teardown( self , reactor , service , command ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( descriptions , command ) = self . parser . extract_neighbors ( command ) #NEWLINE# ( _ , code ) = command . split ( ' ' , 1 ) #NEWLINE# for key in reactor . peers : #NEWLINE# #INDENT# for description in descriptions : #NEWLINE# #INDENT# if reactor . match_neighbor ( description , key ) : #NEWLINE# #INDENT# reactor . peers [ key ] . teardown ( int ( code ) ) #NEWLINE# self . log_message ( ( 'teardown scheduled for %s' % ' ' . join ( description ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# reactor . answer ( service , 'done' ) #NEWLINE# return True #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# reactor . answer ( service , 'error' ) #NEWLINE# return False #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# reactor . answer ( service , 'error' ) #NEWLINE# return False