From 18a3a860b83a8be7790457019e9660f2372f7e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ka=C5=88kovsk=C3=BD?= Date: Tue, 23 Jul 2024 14:47:47 +0200 Subject: [PATCH] Migrate the %onerror and %traceback script --- pyanaconda/exception.py | 3 ++- pyanaconda/modules/runtime/kickstart.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py index 82935a5a772f..8e28866c1fca 100644 --- a/pyanaconda/exception.py +++ b/pyanaconda/exception.py @@ -253,10 +253,11 @@ def _run_kickstart_scripts(self, _dump_info): try: sync_run_task(onerror_task_proxy) sync_run_task(traceback_task_proxy) + # pylint: disable=bare-except + # ruff: noqa: E722 except: pass - def runDebug(self, exc_info): if conf.system.can_switch_tty and self._intf_tty_num != 1: util.vtActivate(1) diff --git a/pyanaconda/modules/runtime/kickstart.py b/pyanaconda/modules/runtime/kickstart.py index 5c45b9e5504e..e18b0174768d 100644 --- a/pyanaconda/modules/runtime/kickstart.py +++ b/pyanaconda/modules/runtime/kickstart.py @@ -17,7 +17,8 @@ # License and may only be used or replicated with the express permission of # Red Hat, Inc. # -from pykickstart.sections import PreInstallScriptSection, PostScriptSection +from pykickstart.sections import (PreInstallScriptSection, + PostScriptSection, TracebackScriptSection, OnErrorScriptSection) from pyanaconda.core.kickstart import KickstartSpecification, commands as COMMANDS from pyanaconda.kickstart import AnacondaKSScript @@ -46,7 +47,6 @@ class RuntimeKickstartSpecification(KickstartSpecification): } sections = { - "pre": lambda handler: PreScriptSection(handler, dataObj=AnacondaKSScript), "pre-install": lambda handler: PreInstallScriptSection(handler, dataObj=AnacondaKSScript), "post": lambda handler: PostScriptSection(handler, dataObj=AnacondaKSScript), "onerror": lambda handler: OnErrorScriptSection(handler, dataObj=AnacondaKSScript),