#NEWLINE# def _destroy_final( self , application ) : #NEWLINE# #INDENT# ' Final destruction of the application on this node and send request to peers to also destroy the app ' #NEWLINE# if hasattr ( application , '_destroy_node_ids' ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# _log . analyze ( self . _node . id , '+' , { #NEWLINE# #INDENT# 'node_info' : application . node_info , #NEWLINE# 'origin_node_id' : application . origin_node_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# application . _destroy_node_ids = { n : None for n in application . node_info . keys ( ) } #NEWLINE# for ( node_id , actor_ids ) in application . node_info . iteritems ( ) : #NEWLINE# #INDENT# if ( not node_id ) : #NEWLINE# #INDENT# _log . analyze ( self . _node . id , '+ UNKNOWN NODE' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# application . _destroy_node_ids [ None ] = response . CalvinResponse ( False ) #NEWLINE# continue #NEWLINE# #UNINDENT# self . _node . proto . app_destroy ( node_id , CalvinCB ( self . _destroy_final_cb , application , node_id ) , node_id . id , actor_ids ) #NEWLINE# #UNINDENT# if ( application . id in self . applications ) : #NEWLINE# #INDENT# del self . applications [ application . id ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( application . origin_node_id not in application . node_info ) and ( application . origin_node_id != self . _node . id ) ) : #NEWLINE# #INDENT# _log . analyze ( self . _node . id , '+ SEP APP NODE' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _node . proto . app_destroy ( application . origin_node_id , None , application . id , [ ] ) #NEWLINE# #UNINDENT# #UNINDENT# self . storage . delete_application ( application . id ) #NEWLINE# self . _destroy_final_cb ( application , '' , response . CalvinResponse ( True ) )