From 949f33b6234f65187838721553518dc38b140e80 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 13 Jul 2019 19:06:42 +0200 Subject: sshtunnel: Update for new openssh version Signed-off-by: Michael Buesch --- awlsim/coreclient/sshtunnel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/awlsim/coreclient/sshtunnel.py b/awlsim/coreclient/sshtunnel.py index 6a4831dd..8741c6a1 100644 --- a/awlsim/coreclient/sshtunnel.py +++ b/awlsim/coreclient/sshtunnel.py @@ -38,6 +38,7 @@ import select import signal import time import getpass +import re class SSHTunnel(object): @@ -205,7 +206,7 @@ class SSHTunnel(object): PROMPT_PW = "'s Password:" PROMPT_AUTH = "The authenticity of host " - PROMPT_YESNO = " (yes/no)?" + PROMPT_YESNO = re.compile(r".*\s\(\[?yes\]?/\[?no\]?(/[\[\]\w\s\d_\-]+)?\)\s*\?\s*") AUTH_FINISH = "Authenticated to " def __handshake(self, ptyMasterFd, timeout): @@ -249,7 +250,8 @@ class SSHTunnel(object): if self.PROMPT_AUTH.lower() in lineLow: authReq.append(line) continue - if self.PROMPT_YESNO.lower() in lineLow and authReq: + if (self.PROMPT_YESNO.match(lineLow, re.IGNORECASE) and + authReq): ok = self.hostAuth("\n".join(authReq)) if not ok: raise AwlSimError("SSH tunnel host " -- cgit v1.2.3