with open("config.json") as f:
CONFIG = json.load(f)
-def open_ssh(config, command):
+def open_ssh(server, command):
+ config = server["ssh"]
subprocess.run(["ssh", config["username"] + "@" + config["host"], "-p", str(config["port"]), command])
def die_with_usage(message):
# SSH sanity tests
- "sanity": lambda s: open_ssh(s["ssh"], "whoami"),
- "console": lambda s: open_ssh(s["ssh"], ""),
+ "sanity": lambda s: open_ssh(s, "whoami"),
+ "console": lambda s: open_ssh(s, ""),
}
def issue_command(server_name, command):