~mterry/duplicity/disappearing-source

« back to all changes in this revision

Viewing changes to duplicity/backends/u1backend.py

  • Committer: "Kenneth Loafman"
  • Author(s): Kenneth Loafman
  • Date: 2013-04-27 13:33:28 UTC
  • mfrom: (911.2.1 trunk)
  • Revision ID: kenneth@loafman.com-20130427133328-c9t75k89m61lv6ep
* Merged in lp:~tblue/duplicity/paramiko-1.10.0
  - This fixes bug #1156746, making the Paramiko backend compatible with
    Paramiko 1.10.0. It keeps compatibility with older Paramiko versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
                          % duplicity.util.exception_traceback())
85
85
                if n == globals.num_retries:
86
86
                    log.FatalError("Giving up on request after %d attempts, last exception %s" % (n,e))
 
87
                body.seek(0) # Go to the beginning of the file for the retry
87
88
                time.sleep(30)
88
89
                continue
89
90
 
105
106
                ecode = log.ErrorCode.backend_no_space
106
107
            elif numcode == 404:
107
108
                ecode = log.ErrorCode.backend_not_found
 
109
 
 
110
            body.seek(0) # Go to the beginning of the file for the retry
108
111
 
109
112
            if n < globals.num_retries:
110
113
                time.sleep(30)
207
210
        remote_full = self.content_base + self.quote(content['content_path'])
208
211
        log.Info("uploading file %s to location %s" % (remote_filename, remote_full))
209
212
 
 
213
        size = os.path.getsize(source_path.name)
210
214
        fh=open(source_path.name,'rb')
211
215
 
212
216
        content_type = 'application/octet-stream'
213
 
        headers = {"Content-Type": content_type}
 
217
        headers = {"Content-Length": str(size),
 
218
                   "Content-Type": content_type}
214
219
        resp, content = self.client.request(remote_full,
215
220
                                            method="PUT",
216
221
                                            body=fh,