diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-11-20 20:29:38 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-11-20 20:29:38 +0100 |
| commit | c23a43fb31f902d8267b7ced1097c5619959bbc5 (patch) | |
| tree | 88160322254ccfb567dde551398188d5f93cc15a | |
| parent | ed05207987a2dae3f548d75f80320d525feb8f1b (diff) | |
Minor changes
| -rwxr-xr-x | clusterman/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clusterman/utils.py b/clusterman/utils.py index 8c24498..a0095b3 100755 --- a/clusterman/utils.py +++ b/clusterman/utils.py @@ -7,6 +7,9 @@ def ssh_exec(host,command,use_key=True): if use_key and len(key_path) > 0: output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "-o", "PasswordAuthentication=no", "-i", CONF["ssh"]["key_path"],"{}@{}".format(user,host), command]) return output.decode("utf-8") + else if use_key: + print("Configuration variable \"key_path\" is not set") + sys.exit(1) else: output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "{}@{}".format(user,host), command]) return output.decode("utf-8") |
