sync: app.py for Butler 2.3.1
This commit is contained in:
parent
d70a42b349
commit
87569b55d5
1 changed files with 3 additions and 2 deletions
5
app.py
5
app.py
|
|
@ -11,7 +11,7 @@ from fastapi.responses import JSONResponse, RedirectResponse
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
log = logging.getLogger("butler")
|
log = logging.getLogger("butler")
|
||||||
VERSION = "2.3.0"
|
VERSION = "2.3.1"
|
||||||
|
|
||||||
API_DIR = os.environ.get("API_KEY_DIR", "/data/api")
|
API_DIR = os.environ.get("API_KEY_DIR", "/data/api")
|
||||||
VAULT_CACHE_DIR = os.environ.get("VAULT_CACHE_DIR", "/data/vault-cache")
|
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):
|
def _ssh(host, cmd, timeout=600):
|
||||||
try:
|
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)
|
capture_output=True, text=True, timeout=timeout)
|
||||||
return r.returncode, r.stdout, r.stderr
|
return r.returncode, r.stdout, r.stderr
|
||||||
except _sp.TimeoutExpired:
|
except _sp.TimeoutExpired:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue