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
1=== modified file 'swift/common/bench.py'
2--- swift/common/bench.py 2011-01-29 03:00:01 +0000
3+++ swift/common/bench.py 2011-04-14 15:39:39 +0000
4@@ -147,6 +147,16 @@
5 self.total = len(names)
6 self.msg = 'DEL'
7
8+ def run(self):
9+ Bench.run(self)
10+ for container in self.containers:
11+ try:
12+ client.delete_container(self.url, self.token, container)
13+ except client.ClientException, e:
14+ if e.http_status != 409:
15+ self._log_status("Unable to delete container '%s'. " \
16+ "Got http status '%d'." % (container, e.http_status))
17+
18 def _run(self, thread):
19 if time.time() - self.heartbeat >= 15:
20 self.heartbeat = time.time()