From 811bbb3e89f03527d98991fbd583238b4aabd996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Tue, 4 Jan 2011 22:37:27 +0100 Subject: [PATCH] Fix paramiko password prompting --- darc/remote.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/darc/remote.py b/darc/remote.py index eb906dc9b..55d83260a 100644 --- a/darc/remote.py +++ b/darc/remote.py @@ -74,8 +74,13 @@ class RemoteStore(object): try: self.client.connect(**params) break - except paramiko.PasswordRequiredException: - params['password'] = getpass.getpass('Password for %(username)s@%(hostname)s:' % params) + except (paramiko.PasswordRequiredException, + paramiko.AuthenticationException, + paramiko.SSHException): + if not 'password' in params: + params['password'] = getpass.getpass('Password for %(username)s@%(hostname)s:' % params) + else: + raise self.unpacker = msgpack.Unpacker() self.transport = self.client.get_transport()