Skip to content

Commit

Permalink
Add an action to check if distupgrader tool is up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sandakov committed Feb 26, 2025
1 parent 34a0850 commit 9c2843d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions centos2almaconverter/upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ def get_check_actions(self, options: typing.Any, phase: Phase) -> typing.List[ac
if not self.disable_spamassasin_plugins:
checks.append(common_actions.AssertSpamassassinAdditionalPluginsDisabled())

if not self.allow_old_script_version:
checks.append(common_actions.AssertScriptVersionUpToDate("https://github.com/plesk/centos2alma", "centos2alma", version.DistupgradeToolVersion(get_version())))

return checks

def parse_args(self, args: typing.Sequence[str]) -> None:
Expand Down Expand Up @@ -307,6 +310,8 @@ def parse_args(self, args: typing.Sequence[str]) -> None:
help="Allow to have direct RAID devices in /etc/fstab. This could lead to unbootable system after the conversion so use the option on your own risk.")
parser.add_argument("--remove-leapp-logs", action="store_true", dest="remove_leapp_logs", default=False,
help="Remove leapp logs after the conversion. By default, the logs are removed after the conversion.")
parser.add_argument("--allow-old-script-version", action="store_true", dest="allow_old_script_version", default=False,
help="Allow to run the script with an old version. By default, the script checks for a new version on GitHub and does not allow to run with an old one.")
options = parser.parse_args(args)

self.upgrade_postgres_allowed = options.upgrade_postgres_allowed
Expand All @@ -316,6 +321,7 @@ def parse_args(self, args: typing.Sequence[str]) -> None:
self.leapp_ovl_size = options.leapp_ovl_size
self.allow_raid_devices = options.allow_raid_devices
self.remove_leapp_logs = options.remove_leapp_logs
self.allow_old_script_version = options.allow_old_script_version


class Centos2AlmaConverterFactory(DistUpgraderFactory):
Expand Down

0 comments on commit 9c2843d

Please sign in to comment.