VR_ID_RANGE = set(range(1, 255))
MAX_ALLOCATION_TRIES = 10
+UNLIMITED_AGENTS_PER_ROUTER = 0
LOG = logging.getLogger(__name__)
if ('/' not in self.ha_cidr or net.network != net.ip):
raise l3_ha.HANetworkCIDRNotValid(cidr=self.ha_cidr)
+ self._check_num_agents_per_router()
+
+ def _check_num_agents_per_router(self):
max_agents = cfg.CONF.max_l3_agents_per_router
min_agents = cfg.CONF.min_l3_agents_per_router
- if max_agents < min_agents:
+
+ if (max_agents != UNLIMITED_AGENTS_PER_ROUTER
+ and max_agents < min_agents):
raise l3_ha.HAMaximumAgentsNumberNotValid(
max_agents=max_agents, min_agents=min_agents)
cfg.CONF.set_override('min_l3_agents_per_router', 0)
self.assertRaises(
l3_ext_ha_mode.HAMinimumAgentsNumberNotValid,
- self.plugin._verify_configuration)
+ self.plugin._check_num_agents_per_router)
def test_verify_configuration_max_l3_agents_below_min_l3_agents(self):
cfg.CONF.set_override('max_l3_agents_per_router', 3)
cfg.CONF.set_override('min_l3_agents_per_router', 4)
self.assertRaises(
l3_ext_ha_mode.HAMaximumAgentsNumberNotValid,
- self.plugin._verify_configuration)
+ self.plugin._check_num_agents_per_router)
+
+ def test_verify_configuration_max_l3_agents_unlimited(self):
+ cfg.CONF.set_override('max_l3_agents_per_router',
+ l3_hamode_db.UNLIMITED_AGENTS_PER_ROUTER)
+ self.plugin._check_num_agents_per_router()
def test_ha_router_create(self):
router = self._create_router()