Cleanup loadbalancer mgt and service ports

Adds a missing driver function to the LB driver to cleanup its management
and service ports on deletion or error, similar to the behavior of routers.

Change-Id: I371a33be15977f20d0806e386e34d0ebf3db9df9
Closes-bug: #1567667
This commit is contained in:
Adam Gandelman 2016-04-07 14:19:20 -07:00
parent 731c346f5e
commit 63a2a59786
1 changed files with 10 additions and 0 deletions

View File

@ -164,6 +164,16 @@ class LoadBalancer(BaseDriver):
return _make_ports
def delete_ports(self, worker_context):
"""Delete all ports.
:param worker_context:
:returns: None
"""
worker_context.neutron.delete_vrrp_port(self.id, label='LB')
worker_context.neutron.delete_vrrp_port(self.id, label='MGT')
@staticmethod
def pre_populate_hook():
"""Fetch the existing LBs from neutron then and returns list back