MOON
Server: Apache
System: Linux server2.shieldcogroup.com 3.10.0-1160.119.1.el7.tuxcare.els12.x86_64 #1 SMP Fri Nov 8 05:49:38 UTC 2024 x86_64
User: jacom (1029)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //etc/leapp/repos.d/system_upgrade/el7toel8/actors/spamassassinconfigupdate/actor.py
from leapp.actors import Actor
from leapp.libraries.actor import spamassassinconfigupdate
from leapp.models import SpamassassinFacts
from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag


class SpamassassinConfigUpdate(Actor):
    """
    This actor performs several modifications to spamassassin configuration
    so that spamc and the spamassassin systemd service can be run without error
    on the target system:
    1. Remove arguments given to the --ssl option in spamc configuration
       (/etc/mail/spamassassin/spamc.conf).
    2. Remove --ssl-version options from the spamassassin sysconfig file
       (/etc/sysconfig/spamassassin), or replace them with --ssl, if needed.
    3. Remove the -d/--daemonize option from the spamassassin sysconfig file.

    All files are backed up before they are modified.
    """

    name = 'spamassassin_config_update'
    consumes = (SpamassassinFacts,)
    produces = ()
    tags = (ApplicationsPhaseTag, IPUWorkflowTag)

    def process(self):
        facts = next(self.consume(SpamassassinFacts), None)
        if facts:
            spamassassinconfigupdate.migrate_configs(facts)
        else:
            self.log.debug('Skipping execution - no SpamassassinFacts message has been produced.')