Skip to content

Commit

Permalink
Update according to comments from Milos
Browse files Browse the repository at this point in the history
Signed-off-by: Vector Li <[email protected]>
  • Loading branch information
Vector Li committed Jun 6, 2023
1 parent 631678a commit 3bba56c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tmt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,7 @@ class Test(
# `test` is mandatory, must exist, so how to initialize if it's missing :(
test: Optional[ShellScript] = field(
default=None,
normalize=lambda key_address, raw_value, logger:
None if raw_value is None else normalize_shell_script(key_address, raw_value, logger))
normalize=normalize_shell_script)
path: Optional[Path] = field(
default=None,
normalize=lambda key_address, raw_value, logger:
Expand Down
4 changes: 2 additions & 2 deletions tmt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4424,7 +4424,7 @@ def normalize_shell_script_list(
def normalize_shell_script(
key_address: str,
value: Union[None, str],
logger: tmt.log.Logger) -> ShellScript:
logger: tmt.log.Logger) -> Optional[ShellScript]:
"""
Normalize a single string input value.
Expand All @@ -4442,7 +4442,7 @@ def normalize_shell_script(
"""

if value is None:
return ShellScript('')
return None

if isinstance(value, str):
return ShellScript(value)
Expand Down

0 comments on commit 3bba56c

Please sign in to comment.