tmt icon indicating copy to clipboard operation
tmt copied to clipboard

mrack restoring a guest fails because of chicken and egg issue of imports

Open happz opened this issue 10 months ago • 0 comments

tmt --root . run --last login would try to resume a guest from previous run. If that guest was provisioned via mrack aka beaker plugin, plugin would try to inspect the Beaker job:

        try:
            response = self.api.inspect()

            if response["status"] == "Aborted":
                return False

            current = cast(GuestInspectType, response)
            state = current["status"]
            if state in {"Error, Aborted", "Cancelled"}:
                return False

            if state == 'Reserved':
                return True
            return False

        except mrack.errors.MrackError:
            return False

Accessing self.api imports mrack, but the code tries to except mrack.errors, which cannot exist yet. Calling import_and_load_mrack_deps() first, before try, should help.

happz avatar May 06 '25 09:05 happz