Merge "Raise retryable exception when the returned search data size is too large"
This commit is contained in:
commit
a30074d4e5
@ -318,6 +318,9 @@ class NsxV3RESTClientTestCase(nsxlib_testcase.NsxClientTestCase):
|
|||||||
exc = client.http_error_to_exception(500, 610)
|
exc = client.http_error_to_exception(500, 610)
|
||||||
self.assertEqual(exc, nsxlib_exc.APITransactionAborted)
|
self.assertEqual(exc, nsxlib_exc.APITransactionAborted)
|
||||||
|
|
||||||
|
exc = client.http_error_to_exception(500, 60506)
|
||||||
|
self.assertEqual(exc, nsxlib_exc.NsxSearchDataTooLarge)
|
||||||
|
|
||||||
exc = client.http_error_to_exception(requests.codes.FORBIDDEN, 505)
|
exc = client.http_error_to_exception(requests.codes.FORBIDDEN, 505)
|
||||||
self.assertEqual(exc, nsxlib_exc.InvalidLicense)
|
self.assertEqual(exc, nsxlib_exc.InvalidLicense)
|
||||||
|
|
||||||
|
@ -120,7 +120,8 @@ def http_error_to_exception(status_code, error_code, related_error_codes=None):
|
|||||||
{'98': exceptions.CannotConnectToServer,
|
{'98': exceptions.CannotConnectToServer,
|
||||||
'99': exceptions.ClientCertificateNotTrusted,
|
'99': exceptions.ClientCertificateNotTrusted,
|
||||||
'607': exceptions.APITransactionAborted,
|
'607': exceptions.APITransactionAborted,
|
||||||
'610': exceptions.APITransactionAborted},
|
'610': exceptions.APITransactionAborted,
|
||||||
|
'60506': exceptions.NsxSearchDataTooLarge},
|
||||||
requests.codes.FORBIDDEN:
|
requests.codes.FORBIDDEN:
|
||||||
{'98': exceptions.BadXSRFToken,
|
{'98': exceptions.BadXSRFToken,
|
||||||
'403': exceptions.InvalidCredentials,
|
'403': exceptions.InvalidCredentials,
|
||||||
|
@ -37,7 +37,8 @@ class ExceptionConfig(object):
|
|||||||
# mark endpoint as DOWN
|
# mark endpoint as DOWN
|
||||||
self.retriables = [v3_exceptions.APITransactionAborted,
|
self.retriables = [v3_exceptions.APITransactionAborted,
|
||||||
v3_exceptions.CannotConnectToServer,
|
v3_exceptions.CannotConnectToServer,
|
||||||
v3_exceptions.ServerBusy]
|
v3_exceptions.ServerBusy,
|
||||||
|
v3_exceptions.NsxSearchDataTooLarge]
|
||||||
|
|
||||||
# When hit during API call, these exceptions will be retried
|
# When hit during API call, these exceptions will be retried
|
||||||
# after the endpoints are regenerated with up-to-date auth
|
# after the endpoints are regenerated with up-to-date auth
|
||||||
|
@ -211,6 +211,10 @@ class NsxSearchPipelineError(NsxLibException):
|
|||||||
message = _("Exception while searching during pipeline execution")
|
message = _("Exception while searching during pipeline execution")
|
||||||
|
|
||||||
|
|
||||||
|
class NsxSearchDataTooLarge(NsxLibException):
|
||||||
|
message = _("Size of data returned by search is too large")
|
||||||
|
|
||||||
|
|
||||||
class NsxPendingDelete(NsxLibException):
|
class NsxPendingDelete(NsxLibException):
|
||||||
message = _("An object with the same name is marked for deletion. Either "
|
message = _("An object with the same name is marked for deletion. Either "
|
||||||
"use another path or wait for the purge cycle to permanently "
|
"use another path or wait for the purge cycle to permanently "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user