Skip to content

Commit

Permalink
FIX remove packages and leftover paths during post/revert of LeapInstall
Browse files Browse the repository at this point in the history
  • Loading branch information
ukablan-wpc committed Sep 27, 2024
1 parent 09cd157 commit 01ca9c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cloudlinux7to8/actions/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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:
Expand Down

0 comments on commit 01ca9c8

Please sign in to comment.