Avoid extra query when overlapping IPs are disabled

Bug 1124363

Change-Id: I431d19a987e18ec2648d9cb0aad185e5ba68f830
This commit is contained in:
Salvatore Orlando 2013-02-13 10:07:24 -08:00
parent 13f4ed7524
commit ba43260108

View File

@ -688,8 +688,9 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
"""
new_subnet_ipset = netaddr.IPSet([new_subnet_cidr])
subnet_list = network.subnets
if not cfg.CONF.allow_overlapping_ips:
if cfg.CONF.allow_overlapping_ips:
subnet_list = network.subnets
else:
subnet_list = self._get_all_subnets(context)
for subnet in subnet_list:
if (netaddr.IPSet([subnet.cidr]) & new_subnet_ipset):