import functools
import subprocess
-def open_ssh(server, command):
+def open_ssh(server, command, force_tty=False):
config = server["ssh"]
- subprocess.run(["ssh", "-t", config["username"] + "@" + config["host"], "-p", str(config["port"]), command])
+ subprocess.run(["ssh", "-t" if force_tty else "", config["username"] + "@" + config["host"], "-p", str(config["port"]), command])
def die_with_usage(message):
print(message)
# TTY access (or keyboard if wired as such)
- "tty": lambda s: open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"])),
+ "tty": lambda s: open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"]), force_tty=True),
# SSH sanity tests