Add NsxInvalidPath exception for error code 500012

We need to handle the 500012 error.

Change-Id: Ifba59b005f507b1ccf01896bfe467e3e3662be65
This commit is contained in:
lxiaopei 2021-11-26 00:32:56 +08:00 committed by xiao pei liu
parent bf42710d11
commit 69662ffa4e
2 changed files with 6 additions and 1 deletions

View File

@ -111,7 +111,8 @@ def http_error_to_exception(status_code, error_code, related_error_codes=None):
'500105': exceptions.NsxOverlapAddresses,
'500232': exceptions.StaleRevision, # Missing dependent objects
'503040': exceptions.NsxSegemntWithVM,
'100148': exceptions.StaleRevision},
'100148': exceptions.StaleRevision,
'500012': exceptions.NsxInvalidPath},
requests.codes.CONFLICT: exceptions.StaleRevision,
requests.codes.PRECONDITION_FAILED: exceptions.StaleRevision,
requests.codes.INTERNAL_SERVER_ERROR:

View File

@ -217,6 +217,10 @@ class NsxPendingDelete(NsxLibException):
"remove the deleted object")
class NsxInvalidPath(ManagerError):
message = _("Invalid path found: %(details)s")
class NsxSegemntWithVM(ManagerError):
message = _("Cannot delete segment as it still has VMs or VIFs attached")