Merge "Ensure that deleted gateway IP address is recycled correctly"

This commit is contained in:
Jenkins 2012-11-19 09:46:20 +00:00 committed by Gerrit Code Review
commit 453dd13738
2 changed files with 4 additions and 1 deletions

View File

@ -502,7 +502,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

@ -2204,6 +2204,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']
@ -2236,6 +2237,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'