From 86cc7add2d0509288e56cffc052d71353324cd73 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 4 Nov 2024 14:40:16 -0500 Subject: [PATCH] Fix status code errors --- bootstrap-daemon/pvcbootstrapd/lib/redfish.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap-daemon/pvcbootstrapd/lib/redfish.py b/bootstrap-daemon/pvcbootstrapd/lib/redfish.py index 116bacc..476104b 100755 --- a/bootstrap-daemon/pvcbootstrapd/lib/redfish.py +++ b/bootstrap-daemon/pvcbootstrapd/lib/redfish.py @@ -198,7 +198,9 @@ class RedfishSession: response = requests.post(url, data=payload, headers=self.headers, verify=False) logger.debug(f"Response: {response.status_code}") - if response.status_code in [200, 201, 204]: + if response.status_code in [201, 204]: + return {"response": "ok"} + elif response.status_code in [200]: try: return response.json() except Exception: