Skip to content

Commit

Permalink
Accept any new fingerprint in ssh util
Browse files Browse the repository at this point in the history
This causes a "yes" response when scp asks about adding a new unknown
fingerprint. This question is typically asked when a new host is
connected to over SSH.

The old behavior would hang on this question, without presenting it to
the user.

Signed-off-by: Jonatan Pålsson <[email protected]>
  • Loading branch information
jonte committed Oct 25, 2016
1 parent 407a7ec commit ee743bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smart/util/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _exec(self, command, **kwargs):
while True:
i = p.expect([pexpect.EOF, pexpect.TIMEOUT,
r"assword:", r"passphrase for key '.*':",
r"\(yes/no\)?"])
r"\(yes/no\)?", r"\(y/n\)"])
if i == 0:
outlist.append(p.before)
break
Expand All @@ -54,7 +54,7 @@ def _exec(self, command, **kwargs):
"but no password is available")
p.sendline(password)
outlist = []
elif i == 4:
elif i == 4 or i == 5:
p.sendline("yes")
outlist = []
while p.isalive():
Expand Down

0 comments on commit ee743bd

Please sign in to comment.