NSXv: Handle listener failures on backend

Backend doesn't produce NotFound exception when deleting a virtual server
or an application profile which doesn't exist.
Instead it produces RequestBad exception which should be caught and handled.

Change-Id: I9f3e7e55ddfea470c69c46b95dd0ac64136ecf97
This commit is contained in:
Kobi Samoray 2018-05-27 16:43:17 +03:00
parent 67a14f7bae
commit d368b041f7
1 changed files with 2 additions and 2 deletions

View File

@ -275,7 +275,7 @@ class EdgeListenerManager(base_mgr.EdgeLoadbalancerBaseManager):
with locking.LockManager.get_lock(edge_id):
self.vcns.delete_vip(edge_id, edge_vse_id)
except vcns_exc.ResourceNotFound:
except (vcns_exc.ResourceNotFound, vcns_exc.RequestBad):
LOG.error(_LE('vip not found on edge: %s'), edge_id)
except vcns_exc.VcnsApiException:
with excutils.save_and_reraise_exception():
@ -287,7 +287,7 @@ class EdgeListenerManager(base_mgr.EdgeLoadbalancerBaseManager):
try:
with locking.LockManager.get_lock(edge_id):
self.vcns.delete_app_profile(edge_id, app_profile_id)
except vcns_exc.ResourceNotFound:
except (vcns_exc.ResourceNotFound, vcns_exc.RequestBad):
LOG.error(_LE('app profile not found on edge: %s'), edge_id)
except vcns_exc.VcnsApiException:
with excutils.save_and_reraise_exception():