Merge lp:~mterry/duplicity/report-encrypted-chains into lp:duplicity/0.6

Proposed by Michael Terry
Status: Merged
Merged at revision: 763
Proposed branch: lp:~mterry/duplicity/report-encrypted-chains
Merge into: lp:duplicity/0.6
Diff against target: 29 lines (+4/-1)
1 file modified
duplicity/collections.py (+4/-1)
To merge this branch: bzr merge lp:~mterry/duplicity/report-encrypted-chains
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+68885@code.launchpad.net

Description of the change

For Deja Dup, I'm trying to support automatically detecting whether a backup is encrypted or not. This is useful especially when restoring so we can ask one less question of the user.

There are several ways to do this, none of which need work on top of today's duplicity:

1) I could watch for the debug message that prints the list of files we found on the backend and look at the suffixes. (WORK NEEDED: make that message machine-parsable; DISADVANTAGES: suffix information would need to be kept in Deja Dup)

2) I could have duplicity not return collection-status information for mismatched encryption states (e.g. if --no-encryption is passed, don't return any encrypted sets in the results). Then Deja Dup would just run collection-status at most twice to see which one returned results. (WORK NEEDED: make duplicity ignore mismached states, which is a trivial two-liner; DISADVANTAGES: seems less useful than it could be for human users and requires at most two passes for machine users)

3) I could have duplicity report in collection-status output whether a backup set is encrypted (but still return results even in a mismatch). (WORK NEEDED: make duplicity note and report encryption status for backup sets; DISADVANTAGES: none?)

So this branch implements #3. But let me know if you prefer the others and I can whip them up.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Ahem, of course I meant "all of which need work..."

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/collections.py'
2--- duplicity/collections.py 2011-06-17 18:22:28 +0000
3+++ duplicity/collections.py 2011-07-22 17:41:23 +0000
4@@ -52,6 +52,7 @@
5 self.start_time = None # will be set if inc
6 self.end_time = None # will be set if inc
7 self.partial = False # true if a partial backup
8+ self.encrypted = False # true if an encrypted backup
9
10 def is_complete(self):
11 """
12@@ -108,6 +109,7 @@
13 self.end_time = pr.end_time
14 self.time = pr.time
15 self.partial = pr.partial
16+ self.encrypted = bool(pr.encrypted)
17 self.info_set = True
18
19 def set_manifest(self, remote_filename):
20@@ -366,7 +368,8 @@
21 else:
22 type = "inc"
23 time = s.end_time
24- l.append("%s%s %s %d" % (prefix, type, dup_time.timetostring(time), (len(s)),))
25+ enc = "enc" if s.encrypted else "noenc"
26+ l.append("%s%s %s %d %s" % (prefix, type, dup_time.timetostring(time), (len(s)), enc))
27 return l
28
29 def __str__(self):

Subscribers

People subscribed via source and target branches

to all changes: