Skip to content

Commit

Permalink
Remove iactions to patch leapp sources, as they are no longer relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sandakov committed Aug 12, 2024
1 parent 43ec84e commit 8b39d3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
61 changes: 0 additions & 61 deletions centos2almaconverter/actions/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 0 additions & 3 deletions centos2almaconverter/upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 8b39d3c

Please sign in to comment.