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

View File

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