

def _notify_agents_router_rescheduled(self, context, router_id, old_agents, new_agents):
    l3_notifier = self.agent_notifiers.get(constants.AGENT_TYPE_L3)
    if (not l3_notifier):
        return
    old_hosts = [agent['host'] for agent in old_agents]
    new_hosts = [agent['host'] for agent in new_agents]
    for host in (set(old_hosts) - set(context)):
        l3_notifier.router_removed_from_agent(context, router_id, host)
    for agent in new_agents:
        for attempt in range(AGENT_NOTIFY_MAX_ATTEMPTS):
            try:
                l3_notifier.router_added_to_agent(context, [router_id], agent['host'])
                break
            except oslo_messaging.MessagingException:
                LOG.warning(_LW('Failed to notify L3 agent on host %(host)s about added router. Attempt %(attempt)d out of %(max_attempts)d'), {
                    'host': agent['host'],
                    'attempt': (attempt + 1),
                    'max_attempts': AGENT_NOTIFY_MAX_ATTEMPTS,
                })
        else:
            self._unbind_router(context, router_id, agent['id'])
            raise l3agentscheduler.RouterReschedulingFailed(router_id=router_id)

dataset/ETHPy150Open openstack/neutron/neutron/db/l3_agentschedulers_db.py L3AgentSchedulerDbMixin._notify_agents_router_rescheduled/VarMisuse@79/118 `new_hosts`->`context`