CI: Drop IP check when connectiong via SSH and pubkey
This commit is contained in:
@@ -84,16 +84,11 @@ class SSHConnection():
|
|||||||
else:
|
else:
|
||||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||||
elif self.sshresponse == 2:
|
elif self.sshresponse == 2:
|
||||||
# Checking if we are really on the remote client defined by its IP address
|
# We directly ended up on the remote server because of pubkey auth
|
||||||
self.ssh.sendline('stdbuf -o0 ifconfig | egrep --color=never "inet addr:|inet "')
|
count = 10
|
||||||
self.sshresponse = self.ssh.expect([ipaddress, pexpect.EOF, pexpect.TIMEOUT])
|
connect_status = True
|
||||||
if self.sshresponse == 0:
|
# this expect() seems to be necessary to advance the read buffer until the prompt, or getBefore() will not return the last command
|
||||||
count = 10
|
self.sshresponse = self.ssh.expect([prompt])
|
||||||
connect_status = True
|
|
||||||
# this expect seems to be necessary to advance the read buffer until the prompt, or getBefore() will not return the last command
|
|
||||||
self.sshresponse = self.ssh.expect([prompt])
|
|
||||||
else:
|
|
||||||
logging.error('logged in to ' + ipaddress + ' without password but IP is not found via ifconfig on remote host, aborting')
|
|
||||||
else:
|
else:
|
||||||
# debug output
|
# debug output
|
||||||
logging.debug(str(self.ssh.before))
|
logging.debug(str(self.ssh.before))
|
||||||
|
|||||||
Reference in New Issue
Block a user