mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
use non-underscore naming for basedeploy helpers
This commit is contained in:
@@ -9,7 +9,7 @@ def get_resource(arg, pkg=__package__):
|
||||
return importlib.resources.files(pkg).joinpath(arg)
|
||||
|
||||
|
||||
def _configure_remote_units(mail_domain, units) -> None:
|
||||
def configure_remote_units(mail_domain, units) -> None:
|
||||
remote_base_dir = "/usr/local/lib/chatmaild"
|
||||
remote_venv_dir = f"{remote_base_dir}/venv"
|
||||
remote_chatmail_inipath = f"{remote_base_dir}/chatmail.ini"
|
||||
@@ -38,7 +38,7 @@ def _configure_remote_units(mail_domain, units) -> None:
|
||||
)
|
||||
|
||||
|
||||
def _activate_remote_units(units) -> None:
|
||||
def activate_remote_units(units) -> None:
|
||||
# activate systemd units
|
||||
for fn in units:
|
||||
basename = fn if "." in fn else f"{fn}.service"
|
||||
|
||||
@@ -21,8 +21,8 @@ from .acmetool import AcmetoolDeployer
|
||||
from .basedeploy import (
|
||||
Deployer,
|
||||
Deployment,
|
||||
_activate_remote_units,
|
||||
_configure_remote_units,
|
||||
activate_remote_units,
|
||||
configure_remote_units,
|
||||
get_resource,
|
||||
)
|
||||
from .dovecot.deployer import DovecotDeployer
|
||||
@@ -315,10 +315,10 @@ class TurnDeployer(Deployer):
|
||||
)
|
||||
|
||||
def configure(self):
|
||||
_configure_remote_units(self.mail_domain, self.units)
|
||||
configure_remote_units(self.mail_domain, self.units)
|
||||
|
||||
def activate(self):
|
||||
_activate_remote_units(self.units)
|
||||
activate_remote_units(self.units)
|
||||
|
||||
|
||||
class IrohDeployer(Deployer):
|
||||
@@ -422,10 +422,10 @@ class EchobotDeployer(Deployer):
|
||||
)
|
||||
|
||||
def configure(self):
|
||||
_configure_remote_units(self.mail_domain, self.units)
|
||||
configure_remote_units(self.mail_domain, self.units)
|
||||
|
||||
def activate(self):
|
||||
_activate_remote_units(self.units)
|
||||
activate_remote_units(self.units)
|
||||
|
||||
|
||||
class ChatmailVenvDeployer(Deployer):
|
||||
@@ -447,10 +447,10 @@ class ChatmailVenvDeployer(Deployer):
|
||||
|
||||
def configure(self):
|
||||
_configure_remote_venv_with_chatmaild(self.config)
|
||||
_configure_remote_units(self.config.mail_domain, self.units)
|
||||
configure_remote_units(self.config.mail_domain, self.units)
|
||||
|
||||
def activate(self):
|
||||
_activate_remote_units(self.units)
|
||||
activate_remote_units(self.units)
|
||||
|
||||
|
||||
class ChatmailDeployer(Deployer):
|
||||
|
||||
@@ -6,8 +6,8 @@ from pyinfra.operations import apt, files, server, systemd
|
||||
|
||||
from cmdeploy.basedeploy import (
|
||||
Deployer,
|
||||
_activate_remote_units,
|
||||
_configure_remote_units,
|
||||
activate_remote_units,
|
||||
configure_remote_units,
|
||||
get_resource,
|
||||
)
|
||||
|
||||
@@ -26,11 +26,11 @@ class DovecotDeployer(Deployer):
|
||||
_install_dovecot_package("lmtpd", arch)
|
||||
|
||||
def configure(self):
|
||||
_configure_remote_units(self.config.mail_domain, self.units)
|
||||
configure_remote_units(self.config.mail_domain, self.units)
|
||||
self.need_restart = _configure_dovecot(self.config)
|
||||
|
||||
def activate(self):
|
||||
_activate_remote_units(self.units)
|
||||
activate_remote_units(self.units)
|
||||
|
||||
restart = False if self.disable_mail else self.need_restart
|
||||
|
||||
|
||||
Reference in New Issue
Block a user