Skip to content

Commit

Permalink
Update db entry before upate the DHCP host file.
Browse files Browse the repository at this point in the history
Update fixed IP db entry before upated the DHCP host file.

Fixes LP Bug #1078718

Change-Id: I75504acfc1c571219938d25a7c3b1a452d3f1cb9
(cherry picked from commit 5149080)
  • Loading branch information
Édouard Thuleau authored and vishvananda committed Nov 21, 2012
1 parent 197398f commit c313de4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nova/network/manager.py
Expand Up @@ -1321,6 +1321,10 @@ def deallocate_fixed_ip(self, context, address, host=None, teardown=True):
self.instance_dns_manager.delete_entry(n,
self.instance_dns_domain)

self.db.fixed_ip_update(context, address,
{'allocated': False,
'virtual_interface_id': None})

if teardown:
network = self._get_network_by_id(context,
fixed_ip_ref['network_id'])
Expand All @@ -1347,10 +1351,6 @@ def deallocate_fixed_ip(self, context, address, host=None, teardown=True):
# callback will get called by nova-dhcpbridge.
self.driver.release_dhcp(dev, address, vif['address'])

self.db.fixed_ip_update(context, address,
{'allocated': False,
'virtual_interface_id': None})

def lease_fixed_ip(self, context, address):
"""Called by dhcp-bridge when ip is leased."""
LOG.debug(_('Leased IP |%(address)s|'), locals(), context=context)
Expand Down

0 comments on commit c313de4

Please sign in to comment.