mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-12 09:30:27 +00:00
Fix paramiko password prompting
This commit is contained in:
parent
0e3ba200b1
commit
811bbb3e89
1 changed files with 7 additions and 2 deletions
|
@ -74,8 +74,13 @@ def __init__(self, location, create=False):
|
||||||
try:
|
try:
|
||||||
self.client.connect(**params)
|
self.client.connect(**params)
|
||||||
break
|
break
|
||||||
except paramiko.PasswordRequiredException:
|
except (paramiko.PasswordRequiredException,
|
||||||
params['password'] = getpass.getpass('Password for %(username)s@%(hostname)s:' % params)
|
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.unpacker = msgpack.Unpacker()
|
||||||
self.transport = self.client.get_transport()
|
self.transport = self.client.get_transport()
|
||||||
|
|
Loading…
Reference in a new issue