Merge lp:~okrasz/duplicity/duplicity into lp:~duplicity-team/duplicity/0.8-series

Proposed by Marcin Okraszewski
Status: Merged
Merged at revision: 1346
Proposed branch: lp:~okrasz/duplicity/duplicity
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 82 lines (+22/-3)
4 files modified
bin/duplicity.1 (+5/-1)
duplicity/backends/azurebackend.py (+11/-2)
duplicity/commandline.py (+3/-0)
duplicity/globals.py (+3/-0)
To merge this branch: bzr merge lp:~okrasz/duplicity/duplicity
Reviewer Review Type Date Requested Status
edso Approve
Marcin Okraszewski (community) Needs Resubmitting
Review via email: mp+361352@code.launchpad.net

Commit message

Add --azure-blob-tier that specifies storage tier (Hot,Cool,Archive) used for uploaded files.

Description of the change

That change was discussed on duplicity-talk. Though, in the master the Azure client was already updated, so that part is gone. Secondly, master code no longer retrieves manifest files during backup process (0.7.18 does so), so there was no need to introduce separate tier settings for manifest and other files. Finally, I've moved it to command line parameter from environment as it seems to fit more this type of setting.

To post a comment you must log in.
Revision history for this message
edso (ed.so) wrote :

hi,

looks good overall. small nitbits though..

1.
please insert the manpage entry where it is alphabetically correct.

2.
manpage text. "storring" can be removed -> 'Standard storage tier used for backup files (Hot|Cool|Archive).'

thanks!.. ede/duply.net

review: Needs Fixing
lp:~okrasz/duplicity/duplicity updated
1347. By Marcin Okraszewski

Putting option in man in alphabetical order + description improvement.

Revision history for this message
Marcin Okraszewski (okrasz) wrote :

Done.

review: Needs Resubmitting
Revision history for this message
edso (ed.so) wrote :

looks good to me.. ede/duply.net

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/duplicity.1'
2--- bin/duplicity.1 2018-07-04 12:21:25 +0000
3+++ bin/duplicity.1 2019-01-03 20:25:18 +0000
4@@ -816,6 +816,10 @@
5 when uploading to S3 to ensure you kill connections to slow S3 endpoints.
6
7 .TP
8+.BI "--azure-blob-tier"
9+Standard storage tier used for backup files (Hot|Cool|Archive).
10+
11+.TP
12 .BI "--azure-max-single-put-size"
13 Specify the number of the largest supported upload size where the Azure
14 library makes only one put call. If the content size is known and below this
15@@ -830,7 +834,7 @@
16 default is 4194304 (4MiB)
17
18 .TP
19-.BI ""--azure-max-connections"
20+.BI "--azure-max-connections"
21 Specify the number of maximum connections to transfer one blob to Azure
22 blob size exceeds 64MB. The default values is 2.
23
24
25=== modified file 'duplicity/backends/azurebackend.py'
26--- duplicity/backends/azurebackend.py 2018-11-29 19:00:15 +0000
27+++ duplicity/backends/azurebackend.py 2019-01-03 20:25:18 +0000
28@@ -102,7 +102,7 @@
29 # fallback for azure-storage<0.30.0
30 except AttributeError:
31 self.blob_service._BLOB_MAX_CHUNK_DATA_SIZE = globals.azure_max_block_size
32-
33+
34 def _create_container(self):
35 try:
36 self.blob_service.create_container(self.container, fail_on_exist=True)
37@@ -124,7 +124,16 @@
38 self.blob_service.create_blob_from_path(self.container, remote_filename, source_path.name, **kwargs)
39 except AttributeError: # Old versions use a different method name
40 self.blob_service.put_block_blob_from_path(self.container, remote_filename, source_path.name, **kwargs)
41-
42+
43+ self._set_tier(remote_filename)
44+
45+ def _set_tier(self, remote_filename):
46+ if globals.azure_blob_tier is not None:
47+ try:
48+ self.blob_service.set_standard_blob_tier(self.container, remote_filename, globals.azure_blob_tier)
49+ except AttributeError: # might not be available in old API
50+ pass
51+
52 def _get(self, remote_filename, local_path):
53 # https://azure.microsoft.com/en-us/documentation/articles/storage-python-how-to-use-blob-storage/#download-blobs
54 self.blob_service.get_blob_to_path(self.container, remote_filename, local_path.name)
55
56=== modified file 'duplicity/commandline.py'
57--- duplicity/commandline.py 2018-11-29 19:00:15 +0000
58+++ duplicity/commandline.py 2019-01-03 20:25:18 +0000
59@@ -590,6 +590,9 @@
60 # max_connections (int) - Maximum number of parallel connections to use when the blob size exceeds 64MB.
61 parser.add_option(u"--azure-max-connections", type=u"int", metavar=_(u"number"))
62
63+ # Standard storage tier used for storring backup files (Hot|Cool|Archive).
64+ parser.add_option(u"--azure-blob-tier", type=u"string", metavar=_(u"Hot|Cool|Archive"))
65+
66 # scp command to use (ssh pexpect backend)
67 parser.add_option(u"--scp-command", metavar=_(u"command"))
68
69
70=== modified file 'duplicity/globals.py'
71--- duplicity/globals.py 2018-11-29 19:00:15 +0000
72+++ duplicity/globals.py 2019-01-03 20:25:18 +0000
73@@ -232,6 +232,9 @@
74 # Maximum number of parallel connections to use when the blob size for azure exceeds 64MB
75 azure_max_connections = None
76
77+# Standard storage tier used for storring backup blobs (Hot|Cool|Archive).
78+azure_blob_tier = None
79+
80 # Whether to use the full email address as the user name when
81 # logging into an imap server. If false just the user name
82 # part of the email address is used.

Subscribers

People subscribed via source and target branches