purge fails for RsyncBackend if used in a multi-backend configuration

Bug #1844750 reported by KDM
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

The RsyncBackend class doesn't implement _delete() to support remote deletion, however it appears that when I use an Rsync backend and a B2 (backblaze) backend, the multibackend class tries to use _delete() from Rsync. I seemed to fix this by adding a delete method to the rsync backend like so:

def _delete(self, filename):
   self._delete_list([filename, ])

but that seems rather inefficient. Perhaps the multi-backend logic needs to change?

Does the following patch seem like a good solution?

diff --git a/duplicity/backends/multibackend.py b/duplicity/backends/multibackend.py
index 7c805ef..aaffd06 100644
--- a/duplicity/backends/multibackend.py
+++ b/duplicity/backends/multibackend.py
@@ -282,7 +282,10 @@ class MultiBackend(duplicity.backend.Backend):
         for s in self.__stores:
             list = s.list()
             if filename in list:
- s._do_delete(filename)
+ if hasattr(s, '_delete_list'):
+ s._do_delete_list([filename, ])
+ elif hasattr(s, '_delete'):
+ s._do_delete(filename)
                 passed = True
                 # In stripe mode, only one item will have the file
                 if self.__mode == 'stripe':

Revision history for this message
KDM (kdm801) wrote :

Oops, the formatting of the patch in the comment box is wrong. Here's the patch

Changed in duplicity:
status: New → Fix Committed
importance: Undecided → Medium
milestone: none → 0.8.05
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.