Merge lp:~johnleach/duplicity/1315437-swift-container-create into lp:duplicity/0.6

Proposed by John Leach
Status: Merged
Merged at revision: 980
Proposed branch: lp:~johnleach/duplicity/1315437-swift-container-create
Merge into: lp:duplicity/0.6
Diff against target: 34 lines (+17/-5)
1 file modified
duplicity/backends/swiftbackend.py (+17/-5)
To merge this branch: bzr merge lp:~johnleach/duplicity/1315437-swift-container-create
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+218373@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
=== modified file 'duplicity/backends/swiftbackend.py'
--- duplicity/backends/swiftbackend.py 2014-04-29 23:49:01 +0000
+++ duplicity/backends/swiftbackend.py 2014-05-06 10:20:37 +0000
@@ -72,13 +72,25 @@
72 72
73 self.container = parsed_url.path.lstrip('/')73 self.container = parsed_url.path.lstrip('/')
7474
75 container_metadata = None
75 try:76 try:
76 self.conn = Connection(**conn_kwargs)77 self.conn = Connection(**conn_kwargs)
77 self.conn.put_container(self.container)78 container_metadata = self.conn.head_container(self.container)
78 except Exception as e:79 except ClientException:
79 log.FatalError("Connection failed: %s %s"80 pass
80 % (e.__class__.__name__, util.uexc(e)),81 except Exception, e:
81 log.ErrorCode.connection_failed)82 log.FatalError("Connection failed: %s %s"
83 % (e.__class__.__name__, str(e)),
84 log.ErrorCode.connection_failed)
85
86 if container_metadata is None:
87 log.Info("Creating container %s" % self.container)
88 try:
89 self.conn.put_container(self.container)
90 except Exception, e:
91 log.FatalError("Container creation failed: %s %s"
92 % (e.__class__.__name__, str(e)),
93 log.ErrorCode.connection_failed)
8294
83 def _error_code(self, operation, e):95 def _error_code(self, operation, e):
84 if isinstance(e, self.resp_exc):96 if isinstance(e, self.resp_exc):

Subscribers

People subscribed via source and target branches

to all changes: