Skip to content

Commit

Permalink
Delete floating ip references to VMIs associated with VIP
Browse files Browse the repository at this point in the history
Change-Id: I5062792bf1c3c4dc225aa9c5319f408a2e40dd4f
Closes-Bug: 1378729
  • Loading branch information
rrugge committed Oct 9, 2014
1 parent c34e4a0 commit 2db1a60
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -176,6 +176,16 @@ def _delete_virtual_interface(self, vmi_list):
for ref in ip_refs:
self._api.instance_ip_delete(id=ref['uuid'])

fip_refs = vmi.get_floating_ip_back_refs()
for ref in fip_refs or []:
try:
fip = self._api.floating_ip_read(id=ref['uuid'])
except NoIdError as ex:
LOG.error(ex)
continue
fip.set_virtual_machine_interface_list([])
self._api.floating_ip_update(fip)

self._api.virtual_machine_interface_delete(id=interface_id)

def create(self, context, vip):
Expand Down

0 comments on commit 2db1a60

Please sign in to comment.