def _teardown_redundancy_router_gw_connectivity(self, context, router,<EOL>router_db,<EOL>plugging_driver):
if not router[ha.ENABLED]:<EOL><INDENT>return<EOL><DEDENT>e_context = context.elevated()<EOL>self._delete_ha_group(e_context, router_db.gw_port_id)<EOL>rr_ids = []<EOL>for r_b_db in router_db.redundancy_bindings:<EOL><INDENT>if plugging_driver is not None:<EOL><INDENT>plugging_driver.teardown_logical_port_connectivity(<EOL>e_context, r_b_db.redundancy_router.gw_port,<EOL>r_b_db.redundancy_router.hosting_info.hosting_device_id)<EOL><DEDENT>self._update_router_no_notify(<EOL>e_context, r_b_db.redundancy_router_id,<EOL>{'<STR_LIT>': {EXTERNAL_GW_INFO: None, ha.ENABLED: False}})<EOL>rr_ids.append(r_b_db.redundancy_router_id)<EOL><DEDENT>self.notify_routers_updated(e_context, rr_ids)<EOL>
To be called in update_router() if the router gateway is to change
        BEFORE router has been updated in DB .