'Return number of agents on which the router will be scheduled.'

def get_number_of_agents_for_scheduling(self, context):

    num_agents = len(self.get_l3_agents(context, active=True, filters={'agent_modes': [constants.L3_AGENT_MODE_LEGACY, constants.L3_AGENT_MODE_DVR_SNAT]}))
    max_agents = cfg.CONF.max_l3_agents_per_router
    if max_agents:
        if (max_agents > num_agents):
            LOG.info(_LI('Number    of    active    agents    lower    than    max_l3_agents_per_router.    L3    agents    available:    %s'), num_agents)
        else:
            num_agents = max_agents
    return num_agents
