fix: handle missing ssh in preflight checks
This commit is contained in:
@@ -569,19 +569,26 @@ def check_ssh_localhost():
|
|||||||
build_dir = os.path.abspath("build")
|
build_dir = os.path.abspath("build")
|
||||||
server_path = os.path.join(build_dir, "server")
|
server_path = os.path.join(build_dir, "server")
|
||||||
|
|
||||||
r = subprocess.run(["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=5",
|
try:
|
||||||
"localhost", "which", "fastsync-server"],
|
r = subprocess.run(["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=5",
|
||||||
capture_output=True, timeout=10)
|
"localhost", "which", "fastsync-server"],
|
||||||
|
capture_output=True, timeout=10)
|
||||||
|
except FileNotFoundError:
|
||||||
|
SSH_AVAILABLE = False
|
||||||
|
return
|
||||||
if r.returncode == 0:
|
if r.returncode == 0:
|
||||||
SSH_AVAILABLE = True
|
SSH_AVAILABLE = True
|
||||||
return
|
return
|
||||||
|
|
||||||
SSH_AVAILABLE = False
|
SSH_AVAILABLE = False
|
||||||
# Try each PATH dir: create symlink, then verify with which
|
# Try each PATH dir: create symlink, then verify with which
|
||||||
r = subprocess.run(
|
try:
|
||||||
["ssh", "-o", "BatchMode=yes", "localhost",
|
r = subprocess.run(
|
||||||
'echo "$PATH"'],
|
["ssh", "-o", "BatchMode=yes", "localhost",
|
||||||
capture_output=True, timeout=10, text=True)
|
'echo "$PATH"'],
|
||||||
|
capture_output=True, timeout=10, text=True)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return
|
||||||
if r.returncode != 0:
|
if r.returncode != 0:
|
||||||
return
|
return
|
||||||
for d in r.stdout.strip().split(":"):
|
for d in r.stdout.strip().split(":"):
|
||||||
|
|||||||
Reference in New Issue
Block a user