From 522fa1b57e64cc9fc88eb0bd2306f6bb81d4930b Mon Sep 17 00:00:00 2001 From: tech Date: Thu, 21 May 2026 12:24:20 +0800 Subject: [PATCH] fix: remove unused subprocess import, guard logs dir in start_tunnel --- src/autossh_mgr/process.py | 1 + tests/unit/test_process.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autossh_mgr/process.py b/src/autossh_mgr/process.py index 52a0f99..f66f42e 100644 --- a/src/autossh_mgr/process.py +++ b/src/autossh_mgr/process.py @@ -130,6 +130,7 @@ def start_tunnel(config_dir: Path, tunnel: TunnelConfig) -> int: raise click.ClickException(f"Port {tunnel.local_port} is already in use") log_path = config_dir / "logs" / f"{tunnel.name}.log" + log_path.parent.mkdir(parents=True, exist_ok=True) env = os.environ.copy() env["AUTOSSH_GATETIME"] = "0" diff --git a/tests/unit/test_process.py b/tests/unit/test_process.py index d9afaf6..685b10a 100644 --- a/tests/unit/test_process.py +++ b/tests/unit/test_process.py @@ -109,7 +109,6 @@ def test_read_pid_file_corrupt(config_dir): import shutil import signal -import subprocess import time from autossh_mgr.config import TunnelConfig from autossh_mgr.process import start_tunnel, stop_tunnel, build_autossh_cmd