diff --git a/smart/util/ssh.py b/smart/util/ssh.py index 17c25fc..ac18f3c 100644 --- a/smart/util/ssh.py +++ b/smart/util/ssh.py @@ -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 @@ -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(): @@ -76,7 +76,7 @@ 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): @@ -84,7 +84,7 @@ def rscp(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, self.username, self.host, src, dst), **kwargs) def exists(self, file):