CI: html tab extention to add more details on built shared and target images

fix ssh connection when remote server has public key

Signed-off-by: Mohammed Ismail <mohammed.ismail@eurecom.fr>
This commit is contained in:
Mohammed Ismail
2021-01-25 11:06:22 +01:00
parent 15ee2bf2c4
commit c9e08d030b
3 changed files with 58 additions and 13 deletions
+2 -4
View File
@@ -52,13 +52,11 @@ class SSHConnection():
self.picocom_closure = True
def open(self, ipaddress, username, password):
extraSshOptions = ''
count = 0
connect_status = False
if ipaddress == '192.168.18.197':
extraSshOptions = ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
while count < 4:
self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress + extraSshOptions], timeout = 5)
self.ssh = pexpect.spawn('ssh -o PubkeyAuthentication=no {}@{}'.format(username,ipaddress))
self.ssh.timeout = 5
self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT])
if self.sshresponse == 0:
self.ssh.sendline('yes')