From 45ad1e94c627f11923cff10c4b8ba19bc3c94310 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Fri, 17 Jan 2025 12:42:06 +0200 Subject: [PATCH] Mark AdoptAptRepositories action as required to revert even if it failed --- pleskdistup/actions/distupgrade.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pleskdistup/actions/distupgrade.py b/pleskdistup/actions/distupgrade.py index 34b9052..5f14e55 100644 --- a/pleskdistup/actions/distupgrade.py +++ b/pleskdistup/actions/distupgrade.py @@ -321,6 +321,12 @@ def __init__( def name(self): return self._name.format(self=self) + def _is_revert_after_fail_required(self) -> bool: + # We might encounter a failure during the 'apt update' process. + # If this occurs, it's necessary to undo any modifications made to the sources.list files. + # Not doing so could stop us from performing 'apt update' in future rollback operations. And we stuck. + return True + def _process_file(self, fpath: str) -> None: files.backup_file(fpath)