NSX|V3+P: Log app profile deletion errors

LBaaS listener application profile deletion might fail if it is being used
in the NSX outside of openstack.
So the driver will only log those errors, and not fail the listener
deletion.

Change-Id: I781cbfe70df87cd0da948fafa85dcbf257b16295
This commit is contained in:
Adit Sarfaty 2019-09-22 08:46:08 +03:00
parent a46e3c9d69
commit 33217514d1
2 changed files with 12 additions and 13 deletions

View File

@ -290,11 +290,11 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
except nsxlib_exc.ResourceNotFound:
LOG.error("application profile not found on nsx: %s",
app_profile_id)
except nsxlib_exc.ManagerError:
completor(success=False)
msg = (_('Failed to delete application profile: %(app)s') %
{'app': app_profile_id})
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
except nsxlib_exc.ManagerError as e:
# This probably means that the application profile is being
# used by a listener outside of openstack
LOG.error("Failed to delete application profile %s from the "
"NSX: %s", app_profile_id, e)
# Delete imported NSX cert if there is any
if listener.get('default_tls_container_id'):

View File

@ -357,14 +357,13 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
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.ManagerError:
completor(success=False)
msg = (_('Failed to delete application profile: %(app)s') %
{'app': app_profile_id})
raise n_exc.BadRequest(resource='lbaas-listener', msg=msg)
LOG.error("application profile not found on nsx: %s",
app_profile_id)
except nsxlib_exc.ManagerError as e:
# This probably means that the application profile is being
# used by a listener outside of openstack
LOG.error("Failed to delete application profile %s from the "
"NSX: %s", app_profile_id, e)
# Delete imported NSX cert if there is any
cert_tags = [{'scope': lb_const.LB_LISTENER_TYPE,