From b110aa9194eb845f9744f8833e8b189f3b2b7396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Fri, 31 Jan 2025 17:52:14 +0100 Subject: [PATCH] Continue after prepare failure in tmt try Useful if machine needs tweaks before prepare can work, e.g. enable repos. Fix: #2685 --- tmt/trying.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tmt/trying.py b/tmt/trying.py index 5cdb128927..03f45bb32e 100644 --- a/tmt/trying.py +++ b/tmt/trying.py @@ -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: @@ -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) @@ -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: """