Raise StaleResource when a 409 is returned by NSX

In order for us to be able to retry on this exception we
raise a StaleResource.

Change-Id: Ide796c56b0479c894c4c644310602c64447b68a4
This commit is contained in:
Gary Kotton 2018-01-03 04:56:09 -08:00
parent 0976764f40
commit 9a1e189386

View File

@ -34,6 +34,7 @@ def http_error_to_exception(status_code, error_code):
requests.codes.NOT_FOUND:
{'202': exceptions.BackendResourceNotFound,
'default': exceptions.ResourceNotFound},
requests.codes.CONFLICT: exceptions.StaleRevision,
requests.codes.PRECONDITION_FAILED: exceptions.StaleRevision,
requests.codes.INTERNAL_SERVER_ERROR:
{'99': exceptions.ClientCertificateNotTrusted},