Merge "NSX|P: Fix loadbalancer deletion port handling" into stable/train

This commit is contained in:
Zuul 2019-12-23 09:00:09 +00:00 committed by Gerrit Code Review
commit 3948ffdee5
1 changed files with 9 additions and 4 deletions

View File

@ -152,10 +152,15 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
port = self.core_plugin.get_port(
context.elevated(), lb['vip_port_id'])
if port.get('device_owner') == lb_const.VMWARE_LB_VIP_OWNER:
self.core_plugin.update_port(
context.elevated(), lb['vip_port_id'],
{'port': {'device_id': '',
'device_owner': ''}})
try:
self.core_plugin.update_port(
context.elevated(), lb['vip_port_id'],
{'port': {'device_id': '',
'device_owner': ''}})
except Exception as e:
# Just log the error as all other resources were deleted
LOG.error("Failed to update neutron port %s devices upon "
"loadbalancer deletion: %s", lb['vip_port_id'], e)
completor(success=True)