def _get_candidates(self, plugin, context, sync_router):
        all_candidates = (
            super(AZLeastRoutersScheduler, self)._get_candidates(
                plugin, context, sync_router))

        candidates = []
        az_hints = self._get_az_hints(sync_router)
        for agent in all_candidates:
            if not az_hints or agent['availability_zone'] in az_hints:
                candidates.append(agent)

        return candidates
Overwrite L3Scheduler's method to filter by availability zone.
dataset/ETHPy150Open openstack/neutron/neutron/scheduler/l3_agent_scheduler.py/AZLeastRoutersScheduler._get_candidates