fix: make Butler runtime probes reliable

This commit is contained in:
sascha 2026-07-22 11:09:42 +02:00
parent 619193bddd
commit 8e07f50c03
4 changed files with 29 additions and 5 deletions

5
app.py
View file

@ -11,7 +11,7 @@ from fastapi.responses import JSONResponse, RedirectResponse
from contextlib import asynccontextmanager
log = logging.getLogger("butler")
VERSION = "2.3.0"
VERSION = "2.3.1"
API_DIR = os.environ.get("API_KEY_DIR", "/data/api")
VAULT_CACHE_DIR = os.environ.get("VAULT_CACHE_DIR", "/data/vault-cache")
@ -788,7 +788,8 @@ class VMCreate(BaseModel):
def _ssh(host, cmd, timeout=600):
try:
r = _sp.run(["ssh","-o","ConnectTimeout=10","-o","StrictHostKeyChecking=accept-new",host,cmd],
r = _sp.run(["ssh","-o","ConnectTimeout=10","-o","StrictHostKeyChecking=accept-new",
"-o","UserKnownHostsFile=/tmp/butler_known_hosts",host,cmd],
capture_output=True, text=True, timeout=timeout)
return r.returncode, r.stdout, r.stderr
except _sp.TimeoutExpired: