Skip to content

Commit

Permalink
Translate Or constraint properly for mrack
Browse files Browse the repository at this point in the history
  • Loading branch information
skycastlelily committed Oct 30, 2024
1 parent 1537bb7 commit f333ffc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tmt/steps/provision/mrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,14 @@ def _translate_tmt_hw(self, hw: tmt.hardware.Hardware) -> dict[str, Any]:
""" Return hw requirements from given hw dictionary """

assert hw.constraint

transformed = MrackHWAndGroup(
children=[
constraint_to_beaker_filter(constraint, logger)
for constraint in hw.constraint.variant()
])
if isinstance(hw.constraint, tmt.hardware.Or):
transformed = constraint_to_beaker_filter(hw.constraint, logger)
else:
transformed = MrackHWAndGroup(
children=[
constraint_to_beaker_filter(constraint, logger)
for constraint in hw.constraint.variant()
])

logger.debug('Transformed hardware', tmt.utils.dict_to_yaml(transformed.to_mrack()))

Expand Down

0 comments on commit f333ffc

Please sign in to comment.