diff --git a/centos2almaconverter/actions/configure.py b/centos2almaconverter/actions/configure.py index c20f89f..6b5c291 100644 --- a/centos2almaconverter/actions/configure.py +++ b/centos2almaconverter/actions/configure.py @@ -79,64 +79,3 @@ def _post_action(self) -> action.ActionResult: def _revert_action(self) -> action.ActionResult: return action.ActionResult() - - -class PatchLeappErrorOutput(action.ActiveAction): - - def __init__(self): - self.name = "patch leapp error log output" - self.path_to_src = "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfplugin.py" - - def _prepare_action(self) -> action.ActionResult: - # Looks like there is no setter for stdout/stderr in the python for leapp - files.replace_string(self.path_to_src, "if six.PY2:", "if False:") - return action.ActionResult() - - def _post_action(self) -> action.ActionResult: - return action.ActionResult() - - def _revert_action(self) -> action.ActionResult: - return action.ActionResult() - - -class PatchLeappDebugNonAsciiPackager(action.ActiveAction): - - def __init__(self): - self.name = "patch leapp to allow print debug message for non-ascii packager" - self.path_to_src = "/usr/share/leapp-repository/repositories/system_upgrade/common/actors/redhatsignedrpmscanner/actor.py" - - def is_required(self) -> bool: - return os.path.exists(self.path_to_src) - - def _prepare_action(self) -> action.ActionResult: - # so sometimes we could have non-ascii packager name, in this case leapp will fail - # on printing debug message. So we need to encode it to utf-8 before print (and only before print I think) - files.replace_string(self.path_to_src, ", pkg.packager", ", pkg.packager.encode('utf-8')") - return action.ActionResult() - - def _post_action(self) -> action.ActionResult: - return action.ActionResult() - - def _revert_action(self) -> action.ActionResult: - return action.ActionResult() - - -class PatchLeappHandleDnfpluginErrorAscii(action.ActiveAction): - path_to_src: str - - def __init__(self): - self.name = "patch leapp to handle dnf plugin error for ascii packager" - self.path_to_src = "/usr/share/leapp-repository/repositories/system_upgrade/common/libraries/dnfplugin.py" - - def is_required(self) -> bool: - return os.path.exists(self.path_to_src) - - def _prepare_action(self) -> action.ActionResult: - files.replace_string(self.path_to_src, "if False", "if True") - return action.ActionResult() - - def _post_action(self) -> action.ActionResult: - return action.ActionResult() - - def _revert_action(self) -> action.ActionResult: - return action.ActionResult() diff --git a/centos2almaconverter/actions/extensions.py b/centos2almaconverter/actions/extensions.py index 33eac10..5b1e098 100644 --- a/centos2almaconverter/actions/extensions.py +++ b/centos2almaconverter/actions/extensions.py @@ -14,9 +14,17 @@ def _prepare_action(self) -> action.ActionResult: leapp_configs.add_repositories_mapping(repofiles) - # For some reason leapp replaces the libssh2 package on installation. It's fine in most cases, - # but imunify packages require libssh2. So we should use PRESENT action to keep it. - leapp_configs.set_package_action("libssh2", leapp_configs.LeappActionType.PRESENT) + # libssh2 and libunwind are needed for imunify360, so we must configure actions for them. + # We need to map the packages to the ones available in the AlmaLinux 8 EPEL repository. + # Additionally, we must remove the actions for libssh2 from the sl repo and + # libunwind from the appstream repo. For some reason, leapp checks all actions + # and becomes confused by these actions. + leapp_configs.set_package_mapping("libssh2", "base", "libssh2", "el8-epel") + leapp_configs.remove_package_action("libssh2", "sl") + + leapp_configs.set_package_action("libunwind", leapp_configs.LeappActionType.REPLACED) + leapp_configs.set_package_mapping("libunwind", "base", "libunwind", "el8-epel") + leapp_configs.remove_package_action("libunwind", "almalinux8-appstream") return action.ActionResult() def _post_action(self) -> action.ActionResult: diff --git a/centos2almaconverter/actions/installation.py b/centos2almaconverter/actions/installation.py index 43cfbe0..ceaba9d 100644 --- a/centos2almaconverter/actions/installation.py +++ b/centos2almaconverter/actions/installation.py @@ -10,9 +10,9 @@ class LeapInstallation(action.ActiveAction): def __init__(self): self.name = "installing leapp" self.pkgs_to_install = [ - "leapp-0.14.0-1.el7", - "python2-leapp-0.14.0-1.el7", - "leapp-data-almalinux-0.1-6.el7", + "leapp-0.16.0-2.el7", + "python2-leapp-0.16.0-2.el7", + "leapp-data-almalinux-0.2-15.el7.20230823", ] def _prepare_action(self) -> action.ActionResult: diff --git a/centos2almaconverter/upgrader.py b/centos2almaconverter/upgrader.py index ff27662..65e5a33 100644 --- a/centos2almaconverter/upgrader.py +++ b/centos2almaconverter/upgrader.py @@ -124,9 +124,6 @@ def construct_actions( centos2alma_actions.AdoptKolabRepositories(), centos2alma_actions.AdoptAtomicRepositories(), centos2alma_actions.FixupImunify(), - centos2alma_actions.PatchLeappErrorOutput(), - centos2alma_actions.PatchLeappDebugNonAsciiPackager(), - centos2alma_actions.PatchLeappHandleDnfpluginErrorAscii(), common_actions.AddUpgradeSystemdService(os.path.abspath(sys.argv[0]), options), common_actions.UpdatePlesk(), centos2alma_actions.PostgresReinstallModernPackage(), diff --git a/dist-upgrader b/dist-upgrader index b34f883..1f72ee1 160000 --- a/dist-upgrader +++ b/dist-upgrader @@ -1 +1 @@ -Subproject commit b34f883136c49bc60f682741661f74e51d0c15f2 +Subproject commit 1f72ee1b7a1c329b1ffdb0d03cc263d9bed529f8