From 85d6b067176f52a73f7b9fe60b45ac8126a41d8c Mon Sep 17 00:00:00 2001 From: Devansh Singh Date: Tue, 12 Mar 2024 21:15:16 +0530 Subject: [PATCH] services/suite.py: contains YAML content instead of file path Signed-off-by: Devansh Singh --- src/teuthology_api/services/suite.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/teuthology_api/services/suite.py b/src/teuthology_api/services/suite.py index 99d2d6d..c1c5819 100644 --- a/src/teuthology_api/services/suite.py +++ b/src/teuthology_api/services/suite.py @@ -1,4 +1,5 @@ from datetime import datetime +from tempfile import NamedTemporaryFile import logging import teuthology.suite @@ -23,8 +24,20 @@ def run(args, send_logs: bool, access_token: str): try: args["--timestamp"] = datetime.now().strftime("%Y-%m-%d_%H:%M:%S") + temp_files: list[NamedTemporaryFile] = [] + if "" in args: + for config in args[""]: + temp_file = NamedTemporaryFile(suffix=".yaml") + temp_file.write(config.encode()) + temp_file.seek(0) + temp_files.append(temp_file) + args[""] = [file.name for file in temp_files] + logs = logs_run(teuthology.suite.main, args) + for file in temp_files: + file.close() + # get run details from paddles run_name = make_run_name( {