Ensure that deleted gateway IP address is recycled correctly

Fixes bug 1079980

Change-Id: I6819899cae6f366423ade70613c85fd84d1a270d
This commit is contained in:
Gary Kotton 2012-11-13 00:12:45 +00:00
parent ff65035bc5
commit 4177a0190d
2 changed files with 4 additions and 1 deletions

View File

@ -495,7 +495,8 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
"""
# Check if the IP is the gateway
if ip_address == gateway_ip:
return True
# Gateway is not in allocation pool
return False
# Check if the requested IP is in a defined allocation pool
pool_qry = context.session.query(models_v2.IPAllocationPool)

View File

@ -2197,6 +2197,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase):
allocation_pools=allocation_pools)
def test_subnet_with_allocation_range(self):
cfg.CONF.set_override('dhcp_lease_duration', 0)
fmt = 'json'
with self.network() as network:
net_id = network['network']['id']
@ -2229,6 +2230,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase):
port_id = port['port']['id']
# delete the port
self._delete('ports', port['port']['id'])
cfg.CONF.set_override('dhcp_lease_duration', 120)
def test_create_subnet_with_none_gateway_allocation_pool(self):
cidr = '10.0.0.0/24'