

def list_routers_on_l3_agent(self, context, agent_id):
    query = context.session.query(RouterL3AgentBinding.router_id)
    query = query.filter((RouterL3AgentBinding.l3_agent_id == agent_id))
    router_ids = [item[0] for item in query]
    if router_ids:
        return {
            'routers': self.get_routers(context, filters={
                'id': router_ids,
            }),
        }
    else:
        self._get_agent(context, agent_id)
        return {
            'routers': [],
        }

dataset/ETHPy150Open openstack/neutron/neutron/db/l3_agentschedulers_db.py L3AgentSchedulerDbMixin.list_routers_on_l3_agent/original