#NEWLINE# def _delete_current_gw_port( self , context , router_id , router , new_network ) : #NEWLINE# #INDENT# '\n        Overriden here to handle deletion of dvr internal ports.\n\n        If there is a valid router update with gateway port to be deleted,\n        then go ahead and delete the csnat ports and the floatingip\n        agent gateway port associated with the dvr router.\n        ' #NEWLINE# gw_ext_net_id = ( router . gw_port [ 'network_id' ] if router . gw_port else None ) #NEWLINE# super ( L3_NAT_with_dvr_db_mixin , self ) . _delete_current_gw_port ( context , router_id , router , new_network ) #NEWLINE# if ( is_distributed_router ( router ) and ( gw_ext_net_id != new_network ) and ( gw_ext_net_id is not None ) ) : #NEWLINE# #INDENT# self . delete_csnat_router_interface_ports ( context . elevated ( ) , router ) #NEWLINE# filters = { #NEWLINE# #INDENT# 'network_id' : [ gw_ext_net_id ] , #NEWLINE# 'device_owner' : [ const . DEVICE_OWNER_ROUTER_GW ] , #NEWLINE# #UNINDENT# } #NEWLINE# ext_net_gw_ports = self . _core_plugin . get_ports ( context . elevated ( ) , filters ) #NEWLINE# if ( not ext_net_gw_ports ) : #NEWLINE# #INDENT# self . delete_floatingip_agent_gateway_port ( context . elevated ( ) , None , gw_ext_net_id ) #NEWLINE# self . l3_rpc_notifier . delete_fipnamespace_for_ext_net ( context , gw_ext_net_id )