Skip to content
Snippets Groups Projects
Verified Commit 03843a6b authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

use built-in raise_for_status in provisioning proxy service

parent a4b2ba43
No related branches found
No related tags found
1 merge request!131Move provisioning proxy steps to the new LSO endpoint
......@@ -6,7 +6,6 @@
import json
import logging
from functools import partial
from http import HTTPStatus
from typing import Any
import requests
......@@ -74,10 +73,7 @@ def _send_request(operation: CUDOperation, endpoint: str, parameters: dict, call
elif operation == CUDOperation.DELETE:
request = requests.delete(url, json=parameters, timeout=10000)
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)
request.raise_for_status()
_send_post = partial(_send_request, CUDOperation.POST)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment