#NEWLINE# def cleanup_ipsets( conf ) : #NEWLINE# #INDENT# LOG . info ( _LI ( 'Destroying IPsets with prefix: %s' ) , conf . prefix ) #NEWLINE# cmd = [ 'ipset' , '-L' , '-n' ] #NEWLINE# ipsets = utils . execute ( cmd , run_as_root = True ) #NEWLINE# for ipset in ipsets . split ( '\n' ) : #NEWLINE# #INDENT# if ( conf . allsets or ipset . startswith ( conf . prefix ) ) : #NEWLINE# #INDENT# destroy_ipset ( conf , ipset ) #NEWLINE# #UNINDENT# #UNINDENT# LOG . info ( _LI ( 'IPset cleanup completed successfully' ) )