def _remove_redundancy_router_interfaces(self, context, router_id,<EOL>old_port):
ha_settings = self._get_ha_settings_by_router_id(context, router_id)<EOL>if ha_settings is None or old_port is None:<EOL><INDENT>return<EOL><DEDENT>e_context = context.elevated()<EOL>rr_ids = self._get_redundancy_router_ids(e_context, router_id)<EOL>port_info_list = self._core_plugin.get_ports(<EOL>e_context, filters={'<STR_LIT>': rr_ids,<EOL>'<STR_LIT>': [old_port['<STR_LIT>']]},<EOL>fields=['<STR_LIT>', '<STR_LIT>', '<STR_LIT:id>'])<EOL>subnet_id = old_port['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>for port_info in port_info_list:<EOL><INDENT>if port_info['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>'] == subnet_id:<EOL><INDENT>interface_info = {'<STR_LIT>': port_info['<STR_LIT:id>']}<EOL>self.remove_router_interface(e_context, port_info['<STR_LIT>'],<EOL>interface_info)<EOL><DEDENT><DEDENT>self._delete_ha_group(e_context, old_port['<STR_LIT:id>'])<EOL>
To be called in delete_router_interface() BEFORE interface has been
        removed from router in DB.