allow more response codes

This commit is contained in:
pedro 2024-10-10 19:09:44 +02:00
parent efac123cdb
commit 3f4a23645d

View file

@ -303,7 +303,7 @@ def send_snapshot_to_devicehub(snapshot, token, url):
} }
try: try:
response = requests.post(url, data=json.dumps(snapshot), headers=headers) response = requests.post(url, data=json.dumps(snapshot), headers=headers)
if response.status_code == 200: if 200 <= response.status_code < 300:
print(f"workbench: INFO: Snapshot successfully sent to '{url}'") print(f"workbench: INFO: Snapshot successfully sent to '{url}'")
else: else:
txt = "workbench: ERROR: Failed to send snapshot. HTTP {}: {}".format( txt = "workbench: ERROR: Failed to send snapshot. HTTP {}: {}".format(