← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~ed.so/duplicity/paramiko.identyfile into lp:duplicity

 

edso has proposed merging lp:~ed.so/duplicity/paramiko.identyfile into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~ed.so/duplicity/paramiko.identyfile/+merge/244347

fix identity file parsing of --ssh-options for paramiko
manpage fixes
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/paramiko.identyfile into lp:duplicity.
=== modified file 'bin/duplicity.1'
--- bin/duplicity.1	2014-12-01 21:09:15 +0000
+++ bin/duplicity.1	2014-12-10 19:12:11 +0000
@@ -60,10 +60,6 @@
 .B boto version 2.0+
 - http://github.com/boto/boto
 .TP
-.BR "cloudfiles backend (deprecated)" " (e.g. Rackspace Open Cloud)"
-.B Cloud Files Python API (deprecated)
-- http://www.rackspace.com/knowledge_center/article/python-api-installation-for-cloud-files
-.TP
 .BR "cfpyrax backend" " (Rackspace Cloud) and " "hubic backend" " (hubic.com)"
 .B Rackspace CloudFiles Pyrax API
 - http://docs.rackspace.com/sdks/guide/content/python.html
@@ -671,7 +667,7 @@
 The format used is designed to be easily consumable by other programs.
 
 .TP
-.BI "--max_blocksize " number
+.BI "--max-blocksize " number
 determines the number of the blocks examined for changes during the diff process.
 For files < 1MB the blocksize is a constant of 512.
 For files over 1MB the size is given by:
@@ -910,22 +906,32 @@
 
 .TP
 .BI "--ssh-options " options
-Allows you to pass options to the ssh backend.  The
+Allows you to pass options to the ssh backend.
+Can be specified multiple times or as a space separated options list.
+The
 .I options
-list should be of the form "-oOpt1=parm1 -oOpt2=parm2" where the option string is
+list should be of the form "-oOpt1='parm1' -oOpt2='parm2'" where the option string is
 quoted and the only spaces allowed are between options. The option string
 will be passed verbatim to both scp and sftp, whose command line syntax
 differs slightly hence the options should therefore be given in the long option format described in
-.BR ssh_config(5) ,
-like in this example:
-
-duplicity --ssh-options="-oProtocol=2 -oIdentityFile=/my/backup/id" /home/me scp://uid@xxxxxxxxxx/some_dir
+.BR ssh_config(5).
+
+example of a list:
+
+duplicity --ssh-options="-oProtocol=2 -oIdentityFile='/my/backup/id'" /home/me scp://user@host/some_dir
+
+example with multiple parameters:
+
+duplicity --ssh-options="-oProtocol=2" --ssh-options="-oIdentityFile='/my/backup/id'" /home/me scp://user@host/some_dir
 
 .B NOTE:
-.I ssh paramiko backend
+The
+.I "ssh paramiko backend"
 currently supports only the
+.B -i
+or
 .B -oIdentityFile
-setting.
+setting. If needed provide more host specific options via ssh_config file.
 .RE
 
 .TP

=== modified file 'duplicity/backends/ssh_paramiko_backend.py'
--- duplicity/backends/ssh_paramiko_backend.py	2014-11-10 20:08:09 +0000
+++ duplicity/backends/ssh_paramiko_backend.py	2014-12-10 19:12:11 +0000
@@ -172,10 +172,10 @@
             self.config.update({'port':int(self.config['port'])})
         else:
             self.config.update({'port':22})
-        # alternative ssh private key, identity file
-        m=re.search("-oidentityfile=(\S+)",globals.ssh_options,re.I)
+        # parse ssh options for alternative ssh private key, identity file
+        m=re.search("^(?:.+\s+)?(?:-oIdentityFile=|-i\s+)(([\"'])([^\\2]+)\\2|[\S]+).*",globals.ssh_options)
         if (m!=None):
-            keyfilename=m.group(1)
+            keyfilename=m.group(3) if m.group(3) else m.group(1)
             self.config['identityfile'] = keyfilename
         # ensure ~ is expanded and identity exists in dictionary
         if 'identityfile' in self.config:


Follow ups