summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-11-20 20:21:15 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-11-20 20:21:15 +0100
commited05207987a2dae3f548d75f80320d525feb8f1b (patch)
treee773c61ed51cce90f32eb9a7a7d4e8784c38aac0
parenta4d3e7134230b02387a8840660eb3de17ff0b88f (diff)
Minor changes
-rwxr-xr-xclusterman/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/clusterman/utils.py b/clusterman/utils.py
index c11883d..8c24498 100755
--- a/clusterman/utils.py
+++ b/clusterman/utils.py
@@ -4,7 +4,7 @@ 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:
+ 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: