On Python 3, map() returns a generator, not a list. Cast explicitly the result
of map() to a list to get a list on Python 2 and Python 3.
The cast is useless in Python 2, but it doesn't hurt performances: it's just a
unit test.
Change-Id: I87486b7dbc42507a6fd7886748a2e09735b6fc5b
xrange is not supported in python 3, so replace it with range since no
large size lists involved.
Closes-Bug: #1237717
Change-Id: I4e5e0782153d32c8beee03f7d871722ed4352859
This patch extracts the multi-threading code from bin/swift into
swiftclient/multithreading and adds tests. In particular, this new way
of doing it (with context managers) will prevent non-daemonic threads
from wedging the process when unexpected exceptions happen.
I enabled reporting of which lines, specifically, are not covered by
unit tests (added -m option to "coverage report" in .unittests).
This patch includes a drive-by fix for uploading a segmented file with
--use-slo when that object already exists. A key of "name" was used
instead of "path", raising KeyError.
There's also another drive-by fix for uploading segmented objects with
--use-slo. Commit 874e0e4427b80e1b15b74a1557b73ba9d61443ca regressed
this by removing the capturing of thread-worker results in
QueueFunctionThread.run(). This patch restores that functionality and
the feature (uploading SLO objects).
Change-Id: I0b4f677e4a734e83d1a25088d9a74f7d46384e53