Fix number of ports requested on pool pre-population

In order to reduce the load when requesting a number of ports
fpr the pre-population the number of ports to be requested
is divided by 2. However, that division can result in a
float number which does not allow the pre-population to finalize.
This commit fixes the issue by retriving the integer part of the
division.

Closes-bug: 1915214
Change-Id: I72d5f4e606d51b2e24703031c3d7fecaa0153c23
This commit is contained in:
Maysa Macedo 2021-02-09 20:21:53 -03:00
parent 2611dc3b3a
commit 99058014bd
1 changed files with 2 additions and 2 deletions

View File

@ -1100,8 +1100,8 @@ class NestedVIFPool(BaseVIFPool):
# NOTE(ltomasbo): If the amount of nodes is large the repopulation
# actions may take too long. Using half of the batch to prevent
# the problem
num_ports = max(oslo_cfg.CONF.vif_pool.ports_pool_batch/2,
oslo_cfg.CONF.vif_pool.ports_pool_min)
num_ports = int(max(oslo_cfg.CONF.vif_pool.ports_pool_batch/2,
oslo_cfg.CONF.vif_pool.ports_pool_min))
self.force_populate_pool(trunk_ip, project_id, subnets,
security_groups, num_ports)