Skip to content

Commit

Permalink
services/suite.py: <config_yaml> contains YAML content instead of fil…
Browse files Browse the repository at this point in the history
…e path

Signed-off-by: Devansh Singh <[email protected]>
  • Loading branch information
Devansh3712 committed Mar 12, 2024
1 parent f0a9d59 commit 85d6b06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/teuthology_api/services/suite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from tempfile import NamedTemporaryFile
import logging
import teuthology.suite

Expand All @@ -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 "<config_yaml>" in args:
for config in args["<config_yaml>"]:
temp_file = NamedTemporaryFile(suffix=".yaml")
temp_file.write(config.encode())
temp_file.seek(0)
temp_files.append(temp_file)
args["<config_yaml>"] = [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(
{
Expand Down

0 comments on commit 85d6b06

Please sign in to comment.