Merge "Refactor to remove _recycle_ip"

This commit is contained in:
Jenkins 2014-02-21 01:36:32 +00:00 committed by Gerrit Code Review
commit f7f5692ee8
2 changed files with 11 additions and 19 deletions

View File

@ -319,14 +319,6 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
return True
return False
@staticmethod
def _recycle_ip(context, network_id, subnet_id, ip_address):
"""Return an IP address to the pool of free IP's on the network
subnet.
"""
NeutronDbPluginV2._delete_ip_allocation(context, network_id, subnet_id,
ip_address)
def update_fixed_ip_lease_expiration(self, context, network_id,
ip_address, lease_remaining):
@ -641,7 +633,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
to_add = self._test_fixed_ips_for_port(context, network_id, new_ips)
for ip in original_ips:
LOG.debug(_("Port update. Hold %s"), ip)
NeutronDbPluginV2._recycle_ip(context,
NeutronDbPluginV2._delete_ip_allocation(context,
network_id,
ip['subnet_id'],
ip['ip_address'])
@ -1402,7 +1394,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
if NeutronDbPluginV2._check_ip_in_allocation_pool(
context, a['subnet_id'], subnet['gateway_ip'],
a['ip_address']):
NeutronDbPluginV2._recycle_ip(context,
NeutronDbPluginV2._delete_ip_allocation(context,
a['network_id'],
a['subnet_id'],
a['ip_address'])

View File

@ -336,7 +336,7 @@ class NetworkGatewayMixin(nvp_networkgw.NetworkGatewayPluginBase):
port_id = port['id']
# now deallocate and recycle ip from the port
for fixed_ip in port.get('fixed_ips', []):
self._recycle_ip(context, network_id,
self._delete_ip_allocation(context, network_id,
fixed_ip['subnet_id'],
fixed_ip['ip_address'])
LOG.debug(_("Ensured no Ip addresses are configured on port %s"),