From a4d3e7134230b02387a8840660eb3de17ff0b88f Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 20 Nov 2023 18:57:52 +0100 Subject: Minor changes --- clusterman/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 clusterman/utils.py (limited to 'clusterman/utils.py') diff --git a/clusterman/utils.py b/clusterman/utils.py old mode 100644 new mode 100755 index 2ab37f0..c11883d --- 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): -- cgit v1.2.3