From 0a5ecb649e2c09fc638159c9c793ad96eb2d01d5 Mon Sep 17 00:00:00 2001 From: Sergey Leonovich Date: Tue, 12 Dec 2023 14:40:41 -0600 Subject: [PATCH] Include function name in service data return and in output file name --- scan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scan.py b/scan.py index a986208..02145ef 100644 --- a/scan.py +++ b/scan.py @@ -163,7 +163,11 @@ def _get_service_data(session, region_name, service, log, max_retries, retry_del region_name, response, ) - return {"region": region_name, "service": service["service"], "result": response} + return { + "region": region_name, + "service": service["service"], + "function": service["function"], + "result": response} def process_region( @@ -319,7 +323,7 @@ def main( except NotADirectoryError: log.error("Invalid directory name: %s", directory) with open( - os.path.join(directory, f"{service_result['service']}.json"), + os.path.join(directory, f"{service_result['service']}-{service_result['function']}.json"), "w", ) as f: json.dump(service_result["result"], f, cls=DateTimeEncoder)