From 56b93e4244a591b65cd5de6e141d0849809e0265 Mon Sep 17 00:00:00 2001 From: steffyP Date: Tue, 8 Aug 2023 15:53:24 +0200 Subject: [PATCH] fix evaluation of not-implemented for stepfunction (#8856) --- scripts/capture_notimplemented_responses.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/capture_notimplemented_responses.py b/scripts/capture_notimplemented_responses.py index 37fc26f611f14..8b907d6415fae 100644 --- a/scripts/capture_notimplemented_responses.py +++ b/scripts/capture_notimplemented_responses.py @@ -73,6 +73,7 @@ def simulate_call(service: str, op: str) -> RowEntry: parameters = generate_request(op_model) or {} result = _make_api_call(client, service, op, parameters) error_msg = result.get("error_message", "") + if result.get("error_code", "") == "InternalError": # some deeper investigation necessary, check for some common errors here and retry if service == "apigateway" and "Unexpected HTTP method" in error_msg: @@ -133,7 +134,9 @@ def simulate_call(service: str, op: str) -> RowEntry: else: # keyword argument not found in the parameters break - + elif result.get("error_code", "") == "UnsupportedOperation" and service == "stepfunctions": + # the stepfunction lib returns 500 for not implemented + UnsupportedOperation + result["status_code"] = 501 # reflect that this is not implemented if result.get("status_code") in [0, 901, 902, 903]: # something went wrong, we do not know exactly what/why - just try again one more time logging.debug(