diff options
-rw-r--r-- | obnamlib/plugins/sftp_plugin.py | 5 | ||||
-rwxr-xr-x | test-sftpfs | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/obnamlib/plugins/sftp_plugin.py b/obnamlib/plugins/sftp_plugin.py index caa600f8..d5ff89a7 100644 --- a/obnamlib/plugins/sftp_plugin.py +++ b/obnamlib/plugins/sftp_plugin.py @@ -146,7 +146,10 @@ class SftpFS(obnamlib.VirtualFileSystem): '-oClearAllForwardings=yes', '-oProtocol=2', '-p', str(self.port), '-l', self.user, - '-s', self.host, 'sftp'] + '-s'] + if self.settings and self.settings['ssh-key']: + args += ['-i', self.settings['ssh-key']] + args += [self.host, 'sftp'] try: proc = subprocess.Popen(args, diff --git a/test-sftpfs b/test-sftpfs index c8ad2ae7..fca64d1c 100755 --- a/test-sftpfs +++ b/test-sftpfs @@ -44,6 +44,7 @@ class SftpTests(unittest.TestCase, obnamlib.VfsTests): 'pure-paramiko': False, 'create': True, 'sftp-delay': 0, + 'ssh-key': '', } self.fs = obnamlib.plugins.sftp_plugin.SftpFS(baseurl, settings=settings) |