NSX|V3 Admin utils expect different notFound error

There are 2 types of "resource not found" errors returned from the nsx
backed.
Status 404 with error code 202, and status 404 with error code 600.
The admin utils should excpect both.

Cherry picked from: I1091dfe4a13610f223229b0b9f63d65956af7cbe

Change-Id: Ib14240e0faecf68543fbedff2f05dc1f01a00d40
This commit is contained in:
Adit Sarfaty 2017-08-30 08:22:58 +03:00
parent d8ea6d0f4e
commit e9ffad5797
1 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ def delete_backend_network(resource, event, trigger, **kwargs):
# check if the network exists
try:
nsxlib.logical_switch.get(nsx_id, silent=True)
except nsx_exc.BackendResourceNotFound:
except nsx_exc.ResourceNotFound:
# prevent logger from logging this exception
sys.exc_clear()
LOG.warning(_LW("Backend network %s was not found."), nsx_id)
@ -127,7 +127,7 @@ def delete_backend_network(resource, event, trigger, **kwargs):
# through errors
try:
nsxlib.logical_switch.get(nsx_id, silent=True)
except nsx_exc.BackendResourceNotFound:
except nsx_exc.ResourceNotFound:
# prevent logger from logging this exception
sys.exc_clear()
LOG.info(_LI("Backend network %s was deleted."), nsx_id)