summaryrefslogtreecommitdiff
path: root/clusterman/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'clusterman/utils.py')
-rwxr-xr-x[-rw-r--r--]clusterman/utils.py6
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):