From 9a2d927938a719d8051b8b877a87c0e89b00bad4 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Mon, 18 Dec 2023 16:48:20 +0100 Subject: [PATCH] don't make GSO fail when LSO returns a status 201 (which is also ok) --- gso/services/provisioning_proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gso/services/provisioning_proxy.py b/gso/services/provisioning_proxy.py index 01cf6983..bd952958 100644 --- a/gso/services/provisioning_proxy.py +++ b/gso/services/provisioning_proxy.py @@ -73,7 +73,8 @@ def _send_request(operation: CUDOperation, endpoint: str, parameters: dict, call elif operation == CUDOperation.DELETE: request = requests.delete(url, json=parameters, timeout=10000) - if request.status_code != HTTPStatus.OK: + if not HTTPStatus.OK <= request.status_code < HTTPStatus.MULTIPLE_CHOICES: + # :term:`LSO` has returned a status code that is outside the 2xx range, and has therefore failed logger.debug(request.content) raise AssertionError(request.content) -- GitLab