#NEWLINE# def _remove_network_profile( self , nprofile_id , db_session = None ) : #NEWLINE# #INDENT# 'Delete a network profile.' #NEWLINE# db_session = ( db_session or db . get_session ( ) ) #NEWLINE# with db_session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# nprofile = db_session . query ( n1kv_models . NetworkProfile ) . filter_by ( id = nprofile_id ) . first ( ) #NEWLINE# if nprofile : #NEWLINE# #INDENT# db_session . delete ( nprofile ) #NEWLINE# #UNINDENT# db_session . query ( n1kv_models . ProfileBinding ) . filter_by ( profile_id = nprofile_id ) . delete ( ) #NEWLINE# return nprofile