~ed.so/duplicity/gdocs.pydrive

« back to all changes in this revision

Viewing changes to duplicity/backends/ssh_paramiko_backend.py

  • Committer: Kenneth Loafman
  • Date: 2015-03-09 18:50:58 UTC
  • Revision ID: kenneth@loafman.com-20150309185058-ktisv2349syunzsl
* Fix for --pydevd debug environment and location under Eclipse.
* Fix for bug where scp was actually working as scp and not working with
  rsync.net because of using extraneous test command in restricted shell.
  Was trying "test -d 'foo' || mkdir -p 'foo'", now only "mkdir -p foo".

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
 
43
43
class SSHParamikoBackend(duplicity.backend.Backend):
44
 
    """This backend accesses files using the sftp protocol, or scp when the --use-scp option is given.
 
44
    """This backend accesses files using the sftp or scp protocols.
45
45
    It does not need any local client programs, but an ssh server and the sftp program must be installed on the remote
46
 
    side (or with --use-scp, the programs scp, ls, mkdir, rm and a POSIX-compliant shell).
 
46
    side (or with scp, the programs scp, ls, mkdir, rm and a POSIX-compliant shell).
47
47
 
48
48
    Authentication keys are requested from an ssh agent if present, then ~/.ssh/id_rsa/dsa are tried.
49
49
    If -oIdentityFile=path is present in --ssh-options, then that file is also tried.
52
52
 
53
53
    Missing directories on the remote side will be created.
54
54
 
55
 
    If --use-scp is active then all operations on the remote side require passing arguments through a shell,
 
55
    If scp is active then all operations on the remote side require passing arguments through a shell,
56
56
    which introduces unavoidable quoting issues: directory and file names that contain single quotes will not work.
57
57
    This problem does not exist with sftp.
58
58
    """
225
225
        if (self.use_scp):
226
226
            # sanity-check the directory name
227
227
            if (re.search("'", self.remote_dir)):
228
 
                raise BackendException("cannot handle directory names with single quotes with --use-scp!")
 
228
                raise BackendException("cannot handle directory names with single quotes with scp")
229
229
 
230
230
            # make directory if needed
231
 
            self.runremote("test -d '%s' || mkdir -p '%s'" % (self.remote_dir, self.remote_dir), False, "scp mkdir ")
 
231
            self.runremote("mkdir -p '%s'" % (self.remote_dir, self.remote_dir), False, "scp mkdir ")
232
232
        else:
233
233
            try:
234
234
                self.sftp = self.client.open_sftp()