aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2019-07-13 19:06:42 +0200
committerMichael Buesch <m@bues.ch>2019-07-13 19:06:42 +0200
commit949f33b6234f65187838721553518dc38b140e80 (patch)
tree5dc28db8141c6661e110f26799512be81ef154b9
parent155bf00d049652023605b789afa91af0633b4b53 (diff)
downloadawlsim-949f33b6234f65187838721553518dc38b140e80.zip
awlsim-949f33b6234f65187838721553518dc38b140e80.tar.xz
sshtunnel: Update for new openssh version
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--awlsim/coreclient/sshtunnel.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/awlsim/coreclient/sshtunnel.py b/awlsim/coreclient/sshtunnel.py
index 6a4831d..8741c6a 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 "
bues.ch cgit interface