Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support amavis #21

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cloudlinux7to8/upgrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self):
self.upgrade_postgres_allowed = False
self.remove_unknown_perl_modules = False
self.disable_spamassasin_plugins = False
self.amavis_upgrade_allowed = False

def __repr__(self) -> str:
attrs = ", ".join(f"{k}={getattr(self, k)!r}" for k in (
Expand Down Expand Up @@ -152,6 +153,7 @@ def construct_actions(
common_actions.HandleUpdatedSpamassassinConfig(),
common_actions.DisableSelinuxDuringUpgrade(),
custom_actions.RestoreMissingNginx(),
common_actions.ReinstallAmavisAntivirus(),
],
"First plesk start": [
common_actions.StartPleskBasicServices(),
Expand Down Expand Up @@ -208,6 +210,7 @@ def get_check_actions(
return [custom_actions.AssertDistroIsCloudLinux8()]

FIRST_SUPPORTED_BY_ALMA_8_PHP_VERSION = "5.6"
CLOUDLINUX8_AMAVIS_REQUIRED_RAM = int(1.5 * 1024 * 1024 * 1024)
checks = [
common_actions.AssertPleskVersionIsAvailable(),
common_actions.AssertPleskInstallerNotInProgress(),
Expand All @@ -230,6 +233,7 @@ def get_check_actions(
custom_actions.AssertMinGovernorMariadbVersion(custom_actions.FIRST_SUPPORTED_GOVERNOR_MARIADB_VERSION),
custom_actions.AssertGovernorMysqlNotInstalled(custom_actions.FIRST_SUPPORTED_GOVERNOR_MARIADB_VERSION),
common_actions.AssertNoMoreThenOneKernelDevelInstalled(),
common_actions.AssertEnoughRamForAmavis(CLOUDLINUX8_AMAVIS_REQUIRED_RAM, self.amavis_upgrade_allowed),
]

if not self.upgrade_postgres_allowed:
Expand Down Expand Up @@ -284,11 +288,14 @@ def parse_args(self, args: typing.Sequence[str]) -> None:
dest="disable_spamassasin_plugins", default=False,
help="Disable additional plugins in spamassasin configuration during the conversion."
)
parser.add_argument("--amavis-upgrade-allowed", action="store_true", dest="amavis_upgrade_allowed", default=False,
help="Allow to upgrade amavis antivirus even if there is not enough RAM available.")
options = parser.parse_args(args)

self.upgrade_postgres_allowed = options.upgrade_postgres_allowed
self.remove_unknown_perl_modules = options.remove_unknown_perl_modules
self.disable_spamassasin_plugins = options.disable_spamassasin_plugins
self.amavis_upgrade_allowed = options.amavis_upgrade_allowed


class CloudLinux7to8Factory(DistUpgraderFactory):
Expand Down
2 changes: 1 addition & 1 deletion dist-upgrader
Loading