From 01ca9c87c3ee746e40eb96d9266c9ed87d52adb6 Mon Sep 17 00:00:00 2001 From: Umit Kablan Date: Fri, 27 Sep 2024 15:47:08 +0300 Subject: [PATCH 1/2] FIX remove packages and leftover paths during post/revert of LeapInstall --- cloudlinux7to8/actions/installation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cloudlinux7to8/actions/installation.py b/cloudlinux7to8/actions/installation.py index d92e090..df92b4f 100644 --- a/cloudlinux7to8/actions/installation.py +++ b/cloudlinux7to8/actions/installation.py @@ -32,7 +32,7 @@ def _prepare_action(self) -> action.ActionResult: util.logged_check_call(["/usr/bin/yum-config-manager", "--disable", "elevate"]) return action.ActionResult() - def _post_action(self) -> action.ActionResult: + def remove_all(self, include_logs: bool = True) -> None: rpm.remove_packages( rpm.filter_installed_packages( self.pkgs_to_install + ["elevate-release", "leapp-upgrade-el7toel8"] @@ -49,16 +49,20 @@ def _post_action(self) -> action.ActionResult: leapp_related_directories = [ "/etc/leapp", "/var/lib/leapp", - "/var/log/leapp", "/usr/lib/python2.7/site-packages/leapp", ] + if include_logs: + leapp_related_directories.append("/var/log/leapp") for directory in leapp_related_directories: if os.path.exists(directory): shutil.rmtree(directory) + def _post_action(self) -> action.ActionResult: + self.remove_all() return action.ActionResult() def _revert_action(self) -> action.ActionResult: + self.remove_all(False) return action.ActionResult() def estimate_prepare_time(self) -> int: From 988ac16c27880a1f3e20f519f9e0f65b831a46b0 Mon Sep 17 00:00:00 2001 From: Umit Kablan Date: Fri, 27 Sep 2024 15:49:18 +0300 Subject: [PATCH 2/2] FIX add `--disablerepo=elevate` to `dnf update` --- cloudlinux7to8/actions/packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudlinux7to8/actions/packages.py b/cloudlinux7to8/actions/packages.py index 195927c..419b8ad 100644 --- a/cloudlinux7to8/actions/packages.py +++ b/cloudlinux7to8/actions/packages.py @@ -213,7 +213,7 @@ def _adopt_plesk_repositories(self) -> None: def _post_action(self) -> action.ActionResult: self._use_rpmnew_repositories() self._adopt_plesk_repositories() - util.logged_check_call(["/usr/bin/dnf", "-y", "update"]) + util.logged_check_call(["/usr/bin/dnf", "-y", "update", "--disablerepo=elevate"]) return action.ActionResult() def _revert_action(self) -> action.ActionResult: