Merge lp:~greglange/swift/lp655401 into lp:~hudson-openstack/swift/trunk

Proposed by Greg Lange
Status: Merged
Approved by: David Goetz
Approved revision: 268
Merged at revision: 270
Proposed branch: lp:~greglange/swift/lp655401
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 20 lines (+10/-0)
1 file modified
swift/common/bench.py (+10/-0)
To merge this branch: bzr merge lp:~greglange/swift/lp655401
Reviewer Review Type Date Requested Status
Swift Core security contacts Pending
Review via email: mp+57573@code.launchpad.net

Commit message

swift-bench to clean up containers after it's done.

To post a comment you must log in.
lp:~greglange/swift/lp655401 updated
267. By Greg Lange <email address hidden>

should probably let the user know when a container delete fails for reasons other than having objects in it

268. By Greg Lange <email address hidden>

moving deleting of containers to run() method makes more sense

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'swift/common/bench.py'
--- swift/common/bench.py 2011-01-29 03:00:01 +0000
+++ swift/common/bench.py 2011-04-14 15:39:39 +0000
@@ -147,6 +147,16 @@
147 self.total = len(names)147 self.total = len(names)
148 self.msg = 'DEL'148 self.msg = 'DEL'
149149
150 def run(self):
151 Bench.run(self)
152 for container in self.containers:
153 try:
154 client.delete_container(self.url, self.token, container)
155 except client.ClientException, e:
156 if e.http_status != 409:
157 self._log_status("Unable to delete container '%s'. " \
158 "Got http status '%d'." % (container, e.http_status))
159
150 def _run(self, thread):160 def _run(self, thread):
151 if time.time() - self.heartbeat >= 15:161 if time.time() - self.heartbeat >= 15:
152 self.heartbeat = time.time()162 self.heartbeat = time.time()