Avoid extra query when overlapping IPs are disabled
Bug 1124363 Change-Id: I431d19a987e18ec2648d9cb0aad185e5ba68f830
This commit is contained in:
parent
13f4ed7524
commit
ba43260108
@ -688,8 +688,9 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
new_subnet_ipset = netaddr.IPSet([new_subnet_cidr])
|
new_subnet_ipset = netaddr.IPSet([new_subnet_cidr])
|
||||||
subnet_list = network.subnets
|
if cfg.CONF.allow_overlapping_ips:
|
||||||
if not cfg.CONF.allow_overlapping_ips:
|
subnet_list = network.subnets
|
||||||
|
else:
|
||||||
subnet_list = self._get_all_subnets(context)
|
subnet_list = self._get_all_subnets(context)
|
||||||
for subnet in subnet_list:
|
for subnet in subnet_list:
|
||||||
if (netaddr.IPSet([subnet.cidr]) & new_subnet_ipset):
|
if (netaddr.IPSet([subnet.cidr]) & new_subnet_ipset):
|
||||||
|
Loading…
Reference in New Issue
Block a user