From 9a1e18938627d4dd87df4401e40ec5539cae122a Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 3 Jan 2018 04:56:09 -0800 Subject: [PATCH] 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 --- vmware_nsxlib/v3/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vmware_nsxlib/v3/client.py b/vmware_nsxlib/v3/client.py index 89110866..a2812a39 100644 --- a/vmware_nsxlib/v3/client.py +++ b/vmware_nsxlib/v3/client.py @@ -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},