Commit 16c758ae authored by Robert Schmidt's avatar Robert Schmidt

CI: Drop IP check when connectiong via SSH and pubkey

parent ae05420c
...@@ -84,16 +84,11 @@ class SSHConnection(): ...@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment