Browse Source

NSXT LB: handle listener deletion failures

When deleting a listener which doesn't exist in the backend, the call
shouldn't fail but delete from OpenStack DB and issue an error to the
log file.

Change-Id: I1ee816d82986a651ea2889b1a4a74889e8724dbb
changes/98/732498/2
Kobi Samoray 1 month ago
parent
commit
a492351970
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py

+ 10
- 8
vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py View File

@@ -220,6 +220,10 @@ class EdgeListenerManager(base_mgr.Nsxv3LoadbalancerBaseManager):
vs_list = lb_service.get('virtual_server_ids')
if vs_list and vs_id in vs_list:
service_client.remove_virtual_server(lbs_id, vs_id)
except (nsxlib_exc.ResourceNotFound,
nsx_exc.NsxResourceNotFound):
LOG.error('Loadbalancing service %s not found at backend' %
lbs_id)
except nsxlib_exc.ManagerError:
self.lbv2_driver.listener.failed_completion(context,
listener)
@@ -238,10 +242,9 @@ class EdgeListenerManager(base_mgr.Nsxv3LoadbalancerBaseManager):
context.session, lb_id, listener.default_pool_id,
None)
vs_client.delete(vs_id)
except nsx_exc.NsxResourceNotFound:
msg = (_("virtual server not found on nsx: %(vs)s") %
{'vs': vs_id})
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
except (nsxlib_exc.ResourceNotFound, nsx_exc.NsxResourceNotFound):
LOG.error("virtual server not found on nsx: %(vs)s" %
{'vs': vs_id})
except nsxlib_exc.ManagerError:
self.lbv2_driver.listener.failed_completion(context,
listener)
@@ -250,10 +253,9 @@ class EdgeListenerManager(base_mgr.Nsxv3LoadbalancerBaseManager):
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
try:
app_client.delete(app_profile_id)
except nsx_exc.NsxResourceNotFound:
msg = (_("application profile not found on nsx: %s") %
app_profile_id)
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
except (nsxlib_exc.ResourceNotFound, nsx_exc.NsxResourceNotFound):
LOG.error("application profile not found on nsx: %s" %
app_profile_id)
except nsxlib_exc.ManagerError:
self.lbv2_driver.listener.failed_completion(context,
listener)


Loading…
Cancel
Save