From cef739e3b38b6a192d0f784dcfd6e61957b3a53b Mon Sep 17 00:00:00 2001 From: j4n Date: Thu, 5 Mar 2026 17:14:35 +0100 Subject: [PATCH] cmdeploy/sshexec: remove dead @docker SSH host @docker is no longer needed because we use @local inside the container now. --- cmdeploy/src/cmdeploy/cmdeploy.py | 10 +++------- cmdeploy/src/cmdeploy/sshexec.py | 7 +------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cmdeploy/src/cmdeploy/cmdeploy.py b/cmdeploy/src/cmdeploy/cmdeploy.py index 52c7de0d..a92d8287 100644 --- a/cmdeploy/src/cmdeploy/cmdeploy.py +++ b/cmdeploy/src/cmdeploy/cmdeploy.py @@ -108,9 +108,7 @@ def run_cmd(args, out): pyinf = "pyinfra --dry" if args.dry_run else "pyinfra" cmd = f"{pyinf} --ssh-user root {ssh_host} {deploy_path} -y" - if ssh_host in ["localhost", "@docker"]: - if ssh_host == "@docker": - env["CHATMAIL_NOPORTCHECK"] = "True" + if ssh_host == "localhost": cmd = f"{pyinf} @local {deploy_path} -y" if version.parse(pyinfra.__version__) < version.parse("3"): @@ -316,7 +314,7 @@ def add_ssh_host_option(parser): parser.add_argument( "--ssh-host", dest="ssh_host", - help="Run commands on 'localhost', via '@docker', or on a specific SSH host " + help="Run commands on 'localhost' or on a specific SSH host " "instead of chatmail.ini's mail_domain.", ) @@ -378,9 +376,7 @@ def get_parser(): def get_sshexec(ssh_host: str, verbose=True): if ssh_host in ["localhost", "@local"]: - return LocalExec(verbose, docker=False) - elif ssh_host == "@docker": - return LocalExec(verbose, docker=True) + return LocalExec(verbose) if verbose: print(f"[ssh] login to {ssh_host}") return SSHExec(ssh_host, verbose=verbose) diff --git a/cmdeploy/src/cmdeploy/sshexec.py b/cmdeploy/src/cmdeploy/sshexec.py index 7470d927..6a37b939 100644 --- a/cmdeploy/src/cmdeploy/sshexec.py +++ b/cmdeploy/src/cmdeploy/sshexec.py @@ -87,9 +87,8 @@ class SSHExec: class LocalExec: FuncError = FuncError - def __init__(self, verbose=False, docker=False): + def __init__(self, verbose=False): self.verbose = verbose - self.docker = docker def __call__(self, call, kwargs=None, log_callback=None): if kwargs is None: @@ -101,10 +100,6 @@ class LocalExec: if not title: title = call.__name__ where = "locally" - if self.docker: - if call == remote.rdns.perform_initial_checks: - kwargs["pre_command"] = "docker exec chatmail " - where = "in docker" if self.verbose: print_stderr(f"Running {where}: {title}(**{kwargs})") return self(call, kwargs, log_callback=print_stderr)