

def create_router_to_agent_binding(self, context, agent, router):
    'Create router to agent binding.'
    router_id = router['id']
    agent_id = agent['id']
    if self.router_scheduler:
        try:
            if router.get('ha'):
                plugin = manager.NeutronManager.get_service_plugins().get(service_constants.L3_ROUTER_NAT)
                self.router_scheduler.create_ha_port_and_bind(plugin, context, router['id'], router['tenant_id'], agent)
            else:
                self.router_scheduler.bind_router(context, router_id, context)
        except db_exc.DBError:
            raise l3agentscheduler.RouterSchedulingFailed(router_id=router_id, agent_id=agent_id)

dataset/ETHPy150Open openstack/neutron/neutron/db/l3_agentschedulers_db.py L3AgentSchedulerDbMixin.create_router_to_agent_binding/VarMisuse@108/162 `agent`->`context`