Skip to content

Commit

Permalink
Fix possible double normalization of hardware field
Browse files Browse the repository at this point in the history
It seems to happen in the very simple workflow, e.g. `tmt run discover plan --name '...'`.
  • Loading branch information
happz committed Jan 13, 2025
1 parent ba6756b commit b7cf102
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tmt/steps/provision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def format(self) -> Iterator[tuple[str, str, str]]:

def normalize_hardware(
key_address: str,
raw_hardware: Optional[tmt.hardware.Spec],
raw_hardware: Union[None, tmt.hardware.Spec, tmt.hardware.Hardware],
logger: tmt.log.Logger) -> Optional[tmt.hardware.Hardware]:
"""
Normalize a ``hardware`` key value.
Expand All @@ -645,6 +645,9 @@ def normalize_hardware(
if raw_hardware is None:
return None

if isinstance(raw_hardware, tmt.hardware.Hardware):
return raw_hardware

# From command line
if isinstance(raw_hardware, (list, tuple)):
merged: dict[str, Any] = {}
Expand Down

0 comments on commit b7cf102

Please sign in to comment.