Merge lp:~ed.so/duplicity/0.6-webdav_fixes into lp:duplicity/0.6

Proposed by edso
Status: Merged
Merged at revision: 846
Proposed branch: lp:~ed.so/duplicity/0.6-webdav_fixes
Merge into: lp:duplicity/0.6
Diff against target: 51 lines (+14/-5)
1 file modified
duplicity/backends/webdavbackend.py (+14/-5)
To merge this branch: bzr merge lp:~ed.so/duplicity/0.6-webdav_fixes
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+96577@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/backends/webdavbackend.py'
2--- duplicity/backends/webdavbackend.py 2011-06-12 13:49:33 +0000
3+++ duplicity/backends/webdavbackend.py 2012-03-08 14:12:21 +0000
4@@ -51,12 +51,18 @@
5
6 webdav backend contributed in 2006 by Jesper Zedlitz <jesper@zedlitz.de>
7 """
8- listbody = """\
9+ # for better compatibility we send an empty listbody as described in
10+ # http://www.ietf.org/rfc/rfc4918.txt
11+ # " A client may choose not to submit a request body. An empty PROPFIND
12+ # request body MUST be treated as if it were an 'allprop' request. "
13+ # it was retired because e.g. box.net didn't support <D:allprop/>
14+ listbody =""
15+ # the following is the retired listbody, just in case
16+ """\
17 <?xml version="1.0" encoding="utf-8" ?>
18 <D:propfind xmlns:D="DAV:">
19 <D:allprop/>
20 </D:propfind>
21-
22 """
23
24 """Connect to remote store using WebDAV Protocol"""
25@@ -74,7 +80,7 @@
26 self.directory = '/'
27
28 log.Info("Using WebDAV host %s" % (parsed_url.hostname,))
29- log.Info("Using WebDAV port %s" % (parsed_url.port,))
30+ log.Info("Using WebDAV port %s" % (parsed_url.port,))
31 log.Info("Using WebDAV directory %s" % (self.directory,))
32 log.Info("Using WebDAV protocol %s" % (globals.webdav_proto,))
33
34@@ -167,12 +173,15 @@
35 del self.headers['Depth']
36 # if the target collection does not exist, create it.
37 if response.status == 404:
38+ response.close()
39 log.Info("Directory '%s' being created." % self.directory)
40- res = self.request("MKCOL", self.directory)
41- log.Info("WebDAV MKCOL status: %s %s" % (res.status, res.reason))
42+ response = self.request("MKCOL", self.directory)
43+ log.Info("WebDAV MKCOL status: %s %s" % (response.status, response.reason))
44+ response.close()
45 continue
46 if response.status == 207:
47 document = response.read()
48+ response.close()
49 break
50 log.Info("WebDAV PROPFIND attempt #%d failed: %s %s" % (n, response.status, response.reason))
51 if n == globals.num_retries +1:

Subscribers

People subscribed via source and target branches

to all changes: