#NEWLINE# def _clean_up_extra_nodes( seen , client , remove = False ) : #NEWLINE# #INDENT# all_nodes = { n . uuid for n in client . node . list ( ) } #NEWLINE# remove_func = client . node . delete #NEWLINE# extra_nodes = ( all_nodes - { n . uuid for n in seen } ) #NEWLINE# for node in extra_nodes : #NEWLINE# #INDENT# if remove : #NEWLINE# #INDENT# LOG . debug ( ( 'Removing extra registered node %s.' % node ) ) #NEWLINE# remove_func ( node ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . debug ( ( 'Extra registered node %s found.' % node ) )