# Associate manager configuration
server["ssh"] = CONFIG["managers"][server["manager"]]
+ # Meta access
+ server["name"] = name
+
return server
def gpio_export(server, pin, mode):
gpio_export(server, pin, False)
+def open_tty(s):
+ if s["tty"]["uncolor"]:
+ # Broken serial port, workaround TTY garbage with libremanage-serial
+ subprocess.run(["libremanage-serial", s["name"])
+ else:
+ # Use native GNU screen
+ return open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"]), force_tty=True),
+
COMMANDS = {
# Power managemment
# TTY access (or keyboard if wired as such)
- "tty": lambda s: open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"]), force_tty=True),
+ "tty": open_tty,
"tty-baud": lambda s: open_ssh(s, "stty -F "+ s["tty"]["file"] + " " + str(s["tty"]["baud"])),
"tty-read": lambda s: open_ssh(s, "cat " + s["tty"]["file"], force_tty=True),
"tty-write": lambda s: open_ssh(s, "stdbuf -o0 cat > " + s["tty"]["file"], force_tty=True),