Skip to content

Commit

Permalink
Continue after prepare failure in tmt try
Browse files Browse the repository at this point in the history
Useful if machine needs tweaks before prepare can work, e.g. enable
repos.

Fix: #2685
  • Loading branch information
lukaszachy committed Feb 11, 2025
1 parent 023d881 commit b110aa9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tmt/trying.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ def action_start_test(self, plan: Plan) -> None:

plan.discover.go()
plan.provision.go()
plan.prepare.go()
try:
plan.prepare.go()
except GeneralError as error:
self.print(str(error))
return
plan.execute.go()

def action_start_login(self, plan: Plan) -> None:
Expand All @@ -349,7 +353,11 @@ def action_start_login(self, plan: Plan) -> None:
self.action_start(plan)

plan.provision.go()
plan.prepare.go()
try:
plan.prepare.go()
except GeneralError as error:
self.print(str(error))
return
assert plan.login is not None # Narrow type
plan.login.go(force=True)

Expand Down Expand Up @@ -446,7 +454,10 @@ def action_prepare(self, plan: Plan) -> None:
Prepare the guest
"""

plan.prepare.go(force=True)
try:
plan.prepare.go(force=True)
except GeneralError as error:
self.print(str(error))

def action_execute(self, plan: Plan) -> None:
"""
Expand Down

0 comments on commit b110aa9

Please sign in to comment.