'Bind the network to the agents.'

def bind(self, context, agents, network_id):

    bound_agents = agents[:]
    for agent in agents:
        agent_id = agent.id
        binding = ndab_model.NetworkDhcpAgentBinding()
        binding.dhcp_agent_id = agent_id
        binding.network_id = network_id
        try:
            with db_api.autonested_transaction(context.session):
                context.session.add(binding)
        except db_exc.DBDuplicateEntry:
            bound_agents.remove(agent)
            LOG.info(_LI('Agent    %s    already    present'), agent_id)
        LOG.debug('Network    %(network_id)s    is    scheduled    to    be    hosted    by    DHCP    agent    %(agent_id)s', {'network_id': network_id, 'agent_id': agent_id})
    super(DhcpFilter, self).bind(context, bound_agents, network_id)
