Skip to content
Snippets Groups Projects
Commit 08118105 authored by Florent Thiery's avatar Florent Thiery
Browse files

fix ssh test refs #20596

parent 0be96f29
No related branches found
No related tags found
No related merge requests found
......@@ -22,13 +22,14 @@ es_utils = imp.load_source('es_utils', '../utils.py')
conf = es_utils.load_conf()
def check_ssh(ip):
cmd = 'timeout 2 ssh -o StrictHostKeyChecking=no %s ls /tmp' % ip
cmd = '/usr/bin/ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no %s ls /tmp' % ip
print('Connecting: %s' % cmd)
status, output = subprocess.getstatusoutput(cmd)
if status != 0:
print('%sFailed to login using SSH%s' % (RED, DEF))
try:
subprocess.check_output(cmd, shell=True, timeout=2)
print('%sLogged in successfully%s' % (GREEN, DEF))
except subprocess.CalledProcessError:
print('%sFailed to login using SSH, run ssh-copy-id %s %s' % (RED, ip, DEF))
return False
print('%sLogged in successfully%s' % (GREEN, DEF))
return True
all_ok = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment