diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-08-17 22:41:58 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-08-17 22:41:58 +0000 |
commit | 6941260d071e41d46266141fead533492163688b (patch) | |
tree | d98152d880e0f395716af673df1f58d6d37affd4 /bin | |
parent | 9a3aa066c37f542356c62f8df9631cff9f163194 (diff) | |
parent | 9083beb41fbc0ab8bcbc5a57ded5dc25dfd96b46 (diff) | |
download | python-swiftclient-6941260d071e41d46266141fead533492163688b.tar.gz |
Merge "Shuffle download order (of containers and objects)"
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -22,6 +22,7 @@ from optparse import OptionParser from os import environ, listdir, makedirs, utime, _exit as os_exit from os.path import basename, dirname, getmtime, getsize, isdir, join from Queue import Empty, Queue +from random import shuffle from sys import argv, exc_info, exit, stderr, stdout from threading import current_thread, enumerate as threading_enumerate, Thread from time import sleep, time @@ -429,9 +430,10 @@ def st_download(parser, args, print_queue, error_queue): conn.get_container(container, marker=marker)[1]] if not objects: break + marker = objects[-1] + shuffle(objects) for obj in objects: object_queue.put((container, obj)) - marker = objects[-1] except ClientException, err: if err.http_status != 404: raise @@ -456,9 +458,10 @@ def st_download(parser, args, print_queue, error_queue): for c in conn.get_account(marker=marker)[1]] if not containers: break + marker = containers[-1] + shuffle(containers) for container in containers: container_queue.put(container) - marker = containers[-1] except ClientException, err: if err.http_status != 404: raise |