def get_agent_by_host(session, agent_host):

    with session.begin(subtransactions=True):
        query = session.query(agents_db.Agent)
        query = query.filter(agents_db.Agent.host == agent_host)
    for agent in query:
        if get_agent_ip(agent):
            return agent
Return a L2 agent on the host.
dataset/ETHPy150Open openstack/neutron/neutron/plugins/ml2/drivers/l2pop/db.py/get_agent_by_host