forked from VallariAg/teuthology-api
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert username to lowercase, update request models for presets
Removed the suite attribute from PresetArgs, created a new model for /update with optional preset fields Signed-off-by: Devansh Singh <[email protected]>
- Loading branch information
1 parent
72c88d9
commit 405a537
Showing
2 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
from teuthology_api.schemas.suite import SuiteArgs | ||
|
||
|
||
class PresetArgs(BaseModel): | ||
name: str | ||
suite: str | ||
cmd: SuiteArgs | ||
|
||
def model_post_init(self, __context): | ||
self.cmd = self.cmd.model_dump() | ||
self.cmd = self.cmd.model_dump(by_alias=True) | ||
|
||
|
||
class PresetUpdateArgs(BaseModel): | ||
name: Optional[str] = None | ||
cmd: Optional[SuiteArgs] = None | ||
|
||
def model_post_init(self, __context): | ||
if self.cmd: | ||
self.cmd = self.cmd.model_dump(by_alias=True) |