diff --git a/src/teuthology_api/schemas/suite.py b/src/teuthology_api/schemas/suite.py index 409e219..f886ec3 100644 --- a/src/teuthology_api/schemas/suite.py +++ b/src/teuthology_api/schemas/suite.py @@ -21,7 +21,7 @@ class SuiteArgs(BaseArgs): kernel: Union[str, None] = Field(default="distro", alias="--kernel") machine_type: Union[str, None] = Field(default="smithi", alias="--machine-type") newest: Union[str, None] = Field(default="0", alias="--newest") - rerun_status: Union[bool, None] = Field(default=False, alias="--rerun-status.") + rerun_status: Union[bool, None] = Field(default=False, alias="--rerun-status") rerun_statuses: Union[str, None] = Field( default="fail,dead", alias="--rerun-statuses" ) @@ -34,7 +34,7 @@ class SuiteArgs(BaseArgs): suite_dir: Union[str, None] = Field(default=None, alias="--suite-dir") suite_relpath: Union[str, None] = Field(default="qa", alias="--suite-relpath") suite_repo: Union[str, None] = Field( - default="https://github.com/ceph/ceph-ci.git", alias="--suite_repo" + default="https://github.com/ceph/ceph-ci.git", alias="--suite-repo" ) teuthology_branch: Union[str, None] = Field( default="main", alias="--teuthology-branch" 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( {