From 0273768c0d55f236f8799c099256aaa352dc1782 Mon Sep 17 00:00:00 2001 From: cliffmccarthy <16453869+cliffmccarthy@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:59:27 -0500 Subject: [PATCH] refactor: Call install, configure, and activate methods in loops - Revised deploy_chatmail() to use all_deployers to call the install(), configure(), and activate() methods on all the deployers, rather than listing them explicitly in the code. --- cmdeploy/src/cmdeploy/__init__.py | 57 ++++--------------------------- 1 file changed, 6 insertions(+), 51 deletions(-) diff --git a/cmdeploy/src/cmdeploy/__init__.py b/cmdeploy/src/cmdeploy/__init__.py index 8f80fb67..adfbae4e 100644 --- a/cmdeploy/src/cmdeploy/__init__.py +++ b/cmdeploy/src/cmdeploy/__init__.py @@ -1203,59 +1203,14 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None: for deployer in all_deployers: deployer.create_users() - chatmail_deployer.install() - turn_deployer.install() - unbound_deployer.install() - iroh_deployer.install() - acmetool_deployer.install() - website_deployer.install() - chatmail_venv_deployer.install() - mtasts_deployer.install() - opendkim_deployer.install() - dovecot_deployer.install() - postfix_deployer.install() - nginx_deployer.install() - rspamd_deployer.install() - fcgiwrap_deployer.install() - echobot_deployer.install() - journald_deployer.install() - mtail_deployer.install() + for deployer in all_deployers: + deployer.install() - chatmail_deployer.configure() - turn_deployer.configure() - unbound_deployer.configure() - iroh_deployer.configure() - acmetool_deployer.configure() - website_deployer.configure() - chatmail_venv_deployer.configure() - mtasts_deployer.configure() - opendkim_deployer.configure() - dovecot_deployer.configure() - postfix_deployer.configure() - nginx_deployer.configure() - rspamd_deployer.configure() - fcgiwrap_deployer.configure() - echobot_deployer.configure() - journald_deployer.configure() - mtail_deployer.configure() + for deployer in all_deployers: + deployer.configure() - chatmail_deployer.activate() - turn_deployer.activate() - unbound_deployer.activate() - iroh_deployer.activate() - acmetool_deployer.activate() - website_deployer.activate() - chatmail_venv_deployer.activate() - mtasts_deployer.activate() - opendkim_deployer.activate() - dovecot_deployer.activate() - postfix_deployer.activate() - nginx_deployer.activate() - rspamd_deployer.activate() - fcgiwrap_deployer.activate() - echobot_deployer.activate() - journald_deployer.activate() - mtail_deployer.activate() + for deployer in all_deployers: + deployer.activate() files.directory( name="Ensure old logs on disk are deleted",