Skip to content

Commit

Permalink
Merge pull request #8 from jonte/ssh_util
Browse files Browse the repository at this point in the history
Fixes for ssh util
  • Loading branch information
afb authored Oct 27, 2016
2 parents 407a7ec + 512ef64 commit aa3b298
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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 All @@ -76,15 +76,15 @@ def scp(self, src, dst, recursive=0, **kwargs):
r = "-r "
else:
r = ""
return self._exec("scp %s-c blowfish %s %s@%s:%s" %
return self._exec("scp %s %s %s@%s:%s" %
(r, src, self.username, self.host, dst), **kwargs)

def rscp(self, src, dst, recursive=0, **kwargs):
if recursive:
r = "-r "
else:
r = ""
return self._exec("scp %s-c blowfish %s@%s:%s %s" %
return self._exec("scp %s %s@%s:%s %s" %
(r, self.username, self.host, src, dst), **kwargs)

def exists(self, file):
Expand Down

0 comments on commit aa3b298

Please sign in to comment.