#NEWLINE# def clean_up( self ) : #NEWLINE# #INDENT# 'Ensure that state from previous runs (old controller processes,\n    sockets, IOLoop object) are cleaned before the next time we\n    bootstrap' #NEWLINE# if ( ( self . controller_manager is not None ) and self . _kill_controllers_on_exit ) : #NEWLINE# #INDENT# self . controller_manager . kill_all ( ) #NEWLINE# #UNINDENT# if ( self . topology is not None ) : #NEWLINE# #INDENT# for switch in self . topology . switches : #NEWLINE# #INDENT# for connection in switch . connections : #NEWLINE# #INDENT# connection . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . controller_patch_panel is not None ) : #NEWLINE# #INDENT# self . controller_patch_panel . clean_up ( ) #NEWLINE# #UNINDENT# msg . unset_io_master ( ) #NEWLINE# if ( self . _io_master is not None ) : #NEWLINE# #INDENT# self . _io_master . close_all ( )