#NEWLINE# @ logging . log_task_wrapper ( LOG . info , _ ( 'Exit context: `network`' ) ) #NEWLINE# def cleanup( self ) : #NEWLINE# #INDENT# net_wrapper = network_wrapper . wrap ( osclients . Clients ( net_wrapper . context [ 'admin' ] [ 'credential' ] ) , self , config = self . config ) #NEWLINE# for ( tenant_id , tenant_ctx ) in six . iteritems ( self . context [ 'tenants' ] ) : #NEWLINE# #INDENT# for network in tenant_ctx . get ( 'networks' , [ ] ) : #NEWLINE# #INDENT# with logging . ExceptionLogger ( LOG , ( _ ( 'Failed to delete network for tenant %s' ) % tenant_id ) ) : #NEWLINE# #INDENT# net_wrapper . delete_network ( network )