fix: _ssh_exec signature in ElephantAlpha
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
OoO
2026-04-28 12:15:42 +08:00
parent 3dd73dce03
commit 32ac92b8f0

View File

@@ -664,18 +664,20 @@ class ElephantAlphaAutonomousEngine:
self._log.error("Telegram escalation failed (non-blocking): %s", e)
# ---- Resource Optimization ----
def _ssh_exec(self, cmd: str, timeout: int = 60) -> tuple:
"""Execute command via SSH jump host."""
def _ssh_exec(self, host: str, user: str, cmd: str, timeout: int = 120) -> tuple:
"""Execute command via SSH jump host to target host."""
import subprocess
import shlex
# 這裡實作 SSH 跳板或直接連線邏輯,根據 ADR-013 應透過跳板機
# 簡化版:直接從容器透過 SSH 連向目標 (188)
full_cmd = [
"ssh",
"-p", str(SSH_PORT),
"-i", SSH_KEY_PATH,
"-o", "StrictHostKeyChecking=no",
"-o", "ConnectTimeout=10",
f"{SSH_JUMP_USER}@{SSH_JUMP_HOST}",
f"{user}@{host}",
cmd
]
try: