Skip to content

Commit

Permalink
FIX Disablerepo cloudlinux-elevate during dnf update
Browse files Browse the repository at this point in the history
  • Loading branch information
ukablan-wpc committed Sep 27, 2024
1 parent 09cd157 commit f9ceea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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_files.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
2 changes: 1 addition & 1 deletion cloudlinux7to8/actions/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f9ceea5

Please sign in to comment.