diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-11-20 18:57:52 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-11-20 18:57:52 +0100 |
| commit | a4d3e7134230b02387a8840660eb3de17ff0b88f (patch) | |
| tree | 57b282d5273d5bd075d5b5b5220492cf42a3e960 /clusterman/utils.py | |
| parent | 9d1fe3b046787d35a7030c2dbb1391b7ac398d49 (diff) | |
Minor changes
Diffstat (limited to 'clusterman/utils.py')
| -rwxr-xr-x[-rw-r--r--] | clusterman/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clusterman/utils.py b/clusterman/utils.py index 2ab37f0..c11883d 100644..100755 --- a/clusterman/utils.py +++ b/clusterman/utils.py @@ -1,14 +1,14 @@ -import subprocess, os, json +import subprocess, os, json, re from clusterman.config import CONF def ssh_exec(host,command,use_key=True): user="root" if len(CONF["ssh"]["user"]) <= 0 else CONF["ssh"]["user"] key_path=CONF["ssh"]["key_path"] if use_key: - output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "-o", "PasswordAuthentication=no", "-i", CONF["ssh"]["key_path"],"{}@{}".format(user,ip), command]) + 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: - output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "{}@{}".format(user,ip), command]) + output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "{}@{}".format(user,host), command]) return output.decode("utf-8") def ping_test(host, timeout=None): |
