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)
|
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_base_dir = "/usr/local/lib/chatmaild"
|
||||||
remote_venv_dir = f"{remote_base_dir}/venv"
|
remote_venv_dir = f"{remote_base_dir}/venv"
|
||||||
remote_chatmail_inipath = f"{remote_base_dir}/chatmail.ini"
|
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
|
# activate systemd units
|
||||||
for fn in units:
|
for fn in units:
|
||||||
basename = fn if "." in fn else f"{fn}.service"
|
basename = fn if "." in fn else f"{fn}.service"
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ from .acmetool import AcmetoolDeployer
|
|||||||
from .basedeploy import (
|
from .basedeploy import (
|
||||||
Deployer,
|
Deployer,
|
||||||
Deployment,
|
Deployment,
|
||||||
_activate_remote_units,
|
activate_remote_units,
|
||||||
_configure_remote_units,
|
configure_remote_units,
|
||||||
get_resource,
|
get_resource,
|
||||||
)
|
)
|
||||||
from .dovecot.deployer import DovecotDeployer
|
from .dovecot.deployer import DovecotDeployer
|
||||||
@@ -315,10 +315,10 @@ class TurnDeployer(Deployer):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
_configure_remote_units(self.mail_domain, self.units)
|
configure_remote_units(self.mail_domain, self.units)
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
_activate_remote_units(self.units)
|
activate_remote_units(self.units)
|
||||||
|
|
||||||
|
|
||||||
class IrohDeployer(Deployer):
|
class IrohDeployer(Deployer):
|
||||||
@@ -422,10 +422,10 @@ class EchobotDeployer(Deployer):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
_configure_remote_units(self.mail_domain, self.units)
|
configure_remote_units(self.mail_domain, self.units)
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
_activate_remote_units(self.units)
|
activate_remote_units(self.units)
|
||||||
|
|
||||||
|
|
||||||
class ChatmailVenvDeployer(Deployer):
|
class ChatmailVenvDeployer(Deployer):
|
||||||
@@ -447,10 +447,10 @@ class ChatmailVenvDeployer(Deployer):
|
|||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
_configure_remote_venv_with_chatmaild(self.config)
|
_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):
|
def activate(self):
|
||||||
_activate_remote_units(self.units)
|
activate_remote_units(self.units)
|
||||||
|
|
||||||
|
|
||||||
class ChatmailDeployer(Deployer):
|
class ChatmailDeployer(Deployer):
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from pyinfra.operations import apt, files, server, systemd
|
|||||||
|
|
||||||
from cmdeploy.basedeploy import (
|
from cmdeploy.basedeploy import (
|
||||||
Deployer,
|
Deployer,
|
||||||
_activate_remote_units,
|
activate_remote_units,
|
||||||
_configure_remote_units,
|
configure_remote_units,
|
||||||
get_resource,
|
get_resource,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -26,11 +26,11 @@ class DovecotDeployer(Deployer):
|
|||||||
_install_dovecot_package("lmtpd", arch)
|
_install_dovecot_package("lmtpd", arch)
|
||||||
|
|
||||||
def configure(self):
|
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)
|
self.need_restart = _configure_dovecot(self.config)
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
_activate_remote_units(self.units)
|
activate_remote_units(self.units)
|
||||||
|
|
||||||
restart = False if self.disable_mail else self.need_restart
|
restart = False if self.disable_mail else self.need_restart
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user