Browse Source

Fix octavia pool delete & delete cascade

Change-Id: I68f1d8369177dc987efa5cd0f7cada363c983ff7
changes/77/761077/1
asarfaty 2 months ago
parent
commit
a7091df66d
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      vmware_nsx/services/lbaas/octavia/octavia_listener.py

+ 9
- 2
vmware_nsx/services/lbaas/octavia/octavia_listener.py View File

@ -347,6 +347,8 @@ class NSXOctaviaListenerEndpoint(object):
pool['listener']['default_pool']['id'] = pool[
'listener']['default_pool']['pool_id']
pool['listeners'] = [pool['listener']]
else:
pool['listeners'] = []
for member in pool.get('members', []):
if not member.get('pool'):
member['pool'] = pool
@ -475,7 +477,7 @@ class NSXOctaviaListenerEndpoint(object):
if pool.get('healthmonitor'):
pool['healthmonitor']['pool'] = pool
try:
self.healthmonitor.delete_cascade(
self.healthmonitor.delete(
ctx, pool['healthmonitor'], dummy_completor)
except Exception as e:
delete_result['value'] = False
@ -485,7 +487,12 @@ class NSXOctaviaListenerEndpoint(object):
try:
if not member.get('pool'):
member['pool'] = pool
self.member.delete_cascade(ctx, member, dummy_completor)
if ('loadbalancer' in member['pool'] and
not member.get('subnet_id')):
# Use the parent vip_subnet_id instead
member['subnet_id'] = member['pool']['loadbalancer'][
'vip_subnet_id']
self.member.delete(ctx, member, dummy_completor)
except Exception as e:
delete_result['value'] = False
LOG.error('NSX driver pool_delete failed to delete member'


Loading…
Cancel
Save