Merge "NSXV: Handle missing pool object properly" into stable/train

This commit is contained in:
Zuul 2021-03-04 13:16:47 +00:00 committed by Gerrit Code Review
commit 17cc5bb1fe
1 changed files with 10 additions and 1 deletions

View File

@ -169,7 +169,16 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.EdgeLoadbalancerBaseManager):
hm_binding = nsxv_db.get_nsxv_lbaas_monitor_binding( hm_binding = nsxv_db.get_nsxv_lbaas_monitor_binding(
context.session, lb_id, pool_id, hm['id'], edge_id) context.session, lb_id, pool_id, hm['id'], edge_id)
edge_pool = self.vcns.get_pool(edge_id, edge_pool_id)[1] try:
edge_pool = self.vcns.get_pool(edge_id, edge_pool_id)[1]
except nsxv_exc.RequestBad:
# Pool doesn't exist, so member is obviously gone
LOG.warning('Edge pool %s does not exist on edge %s',
edge_pool_id, edge_id)
nsxv_db.del_nsxv_lbaas_monitor_binding(
context.session, lb_id, pool_id, hm['id'], edge_id)
completor(success=True)
return
if hm_binding and hm_binding['edge_mon_id'] in edge_pool['monitorId']: if hm_binding and hm_binding['edge_mon_id'] in edge_pool['monitorId']:
edge_pool['monitorId'].remove(hm_binding['edge_mon_id']) edge_pool['monitorId'].remove(hm_binding['edge_mon_id'])