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
This commit is contained in:
parent
c0da5a9c44
commit
fb77ab9659
|
@ -333,6 +333,9 @@ class EdgeListenerManagerFromDict(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:
|
||||
completor(success=False)
|
||||
msg = (_('Failed to remove virtual server: %(listener)s '
|
||||
|
@ -351,10 +354,9 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
|||
if persist_profile_id:
|
||||
lb_utils.delete_persistence_profile(
|
||||
self.core_plugin.nsxlib, persist_profile_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:
|
||||
completor(success=False)
|
||||
msg = (_('Failed to delete virtual server: %(listener)s') %
|
||||
|
@ -362,7 +364,7 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
|||
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
|
||||
try:
|
||||
app_client.delete(app_profile_id)
|
||||
except nsx_exc.NsxResourceNotFound:
|
||||
except (nsxlib_exc.ResourceNotFound, nsx_exc.NsxResourceNotFound):
|
||||
LOG.error("application profile not found on nsx: %s",
|
||||
app_profile_id)
|
||||
except nsxlib_exc.ManagerError as e:
|
||||
|
|
Loading…
Reference in New Issue