diff --git a/vmware_nsxlib/v3/client.py b/vmware_nsxlib/v3/client.py index d088cd1c..c9047251 100644 --- a/vmware_nsxlib/v3/client.py +++ b/vmware_nsxlib/v3/client.py @@ -37,7 +37,8 @@ def http_error_to_exception(status_code, error_code): requests.codes.BAD_REQUEST: {'60508': exceptions.NsxIndexingInProgress, '60514': exceptions.NsxSearchTimeout, - '500045': exceptions.NsxPendingDelete}, + '500045': exceptions.NsxPendingDelete, + '500030': exceptions.ResourceInUse}, requests.codes.CONFLICT: exceptions.StaleRevision, requests.codes.PRECONDITION_FAILED: exceptions.StaleRevision, requests.codes.INTERNAL_SERVER_ERROR: diff --git a/vmware_nsxlib/v3/exceptions.py b/vmware_nsxlib/v3/exceptions.py index d8292ac2..f74547ec 100644 --- a/vmware_nsxlib/v3/exceptions.py +++ b/vmware_nsxlib/v3/exceptions.py @@ -196,4 +196,9 @@ class NsxPendingDelete(NsxLibException): class APITransactionAborted(ServerBusy): - message = _("API transaction aborted as MP cluster is reconfiguring.") + message = _("API transaction aborted as MP cluster is reconfiguring") + + +class ResourceInUse(ManagerError): + message = _("The object cannot be deleted as either it has children or it " + "is being referenced by other objects")