diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py index 42652d303f..84c228eb52 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/networks.py @@ -107,7 +107,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("Backend network %s was not found.", nsx_id) @@ -125,7 +125,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("Backend network %s was deleted.", nsx_id) diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py index 4115dff4c6..f1b2b80859 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/routers.py @@ -141,7 +141,7 @@ def delete_backend_router(resource, event, trigger, **kwargs): # check if the router exists try: nsxlib.logical_router.get(nsx_id, silent=True) - except nsx_exc.BackendResourceNotFound: + except nsx_exc.ResourceNotFound: # prevent logger from logging this exception sys.exc_clear() LOG.warning("Backend router %s was not found.", nsx_id) @@ -163,7 +163,7 @@ def delete_backend_router(resource, event, trigger, **kwargs): # throws errors try: nsxlib.logical_router.get(nsx_id, silent=True) - except nsx_exc.BackendResourceNotFound: + except nsx_exc.ResourceNotFound: # prevent logger from logging this exception sys.exc_clear() LOG.info("Backend router %s was deleted.", nsx_id)