Fix status code errors

This commit is contained in:
Joshua Boniface 2024-11-04 14:40:16 -05:00
parent f529f8fcd2
commit 86cc7add2d
1 changed files with 3 additions and 1 deletions

View File

@ -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: