'Event handler to react to changes after HA flag has been updated.'

@registry.receives(resources.ROUTER, [events.AFTER_UPDATE])
def _reconfigure_ha_resources(self, resource, event, trigger, context, router_id, old_router, router, router_db, **kwargs):

    ha_changed = (old_router['ha'] != router['ha'])
    if (not ha_changed):
        return
    requested_ha_state = router['ha']
    self._unbind_ha_router(context, router_id)
    if (not requested_ha_state):
        self._delete_ha_interfaces(context, router_db.id)
        ha_network = self.get_ha_network(context, router_db.tenant_id)
        if ha_network:
            self.safe_delete_ha_network(context, ha_network, router_db.tenant_id)
        self._migrate_router_ports(context, router_db, old_owner=constants.DEVICE_OWNER_HA_REPLICATED_INT, new_owner=constants.DEVICE_OWNER_ROUTER_INTF)
    self.schedule_router(context, router_id)
    self._notify_router_updated(context, router_db.id)
