Allow storage url override for both auth vers.

When --os-storage-url is specified on the command-line to bin/swift, it
will override the used storage URL regardless of authentication for both
authentication version 1 and version 2.  This can be used to bypass a
load-balancer to hit a specific proxy server for testing/debugging
purposes.

Within the client library, this feature is accessed by passing the
desired storage URL into swiftclient.client.Conection.__init__() via the
os_options keyword argument.  For example:

  conn = Connection(auth_url, user, key, os_options={
    'object_storage_url': 'http://overridden.storage.url/AUTH_foo'})

This patch also adds a dependency on mock>=0.8.0, which is the same as
openstack/swift.

Change-Id: Id2a36ed6abffd65e7762b6beea5bbfc6c036e848
Allow setting # of retries in the binary

Change-Id: I7ef4f1f86cc6ea4937043ea7bf7d9526e23bd2c7
Merge "Allow storage url override for both auth vers."
Merge "Allow setting # of retries in the binary"
Adds max-backoff for retries in Connection.

The max-backoff concept prevents the backoff used in _retry to double infinitely (which in turn causes wait times of an hour or more between retries).

As per review, changed code to use min instead.

Fixes: bug #1183542

Change-Id: Ic084f54069b7fa7a33604741487045c5e697ff06
Refuse carriage return in header value

See bug #1188896.
Comparing with Curl and Django, they both refuse carriage returns in
header values, so the request() method on the HTTP(S)Connection instance
returned by swiftclient.client.http_connection() will raise an
InvalidHeadersException if any of the headers to be sent contain a
newline.

Drive-by fix for a couple of header values which were integers instead
of strings (Content-Length getting set to zero).

Fixes bug #1188896

Change-Id: Ic6afdb92882284f843aacb06d20f682ddcb47151
Merge "Adds max-backoff for retries in Connection."
Update docstring for swiftclient.Connection.__init__

There were two undocumented parameters in there, one introduced
recently in 6411fd3, and the other some time before.

Change-Id: I3a7d59e1c272b382b035b88ba5495bc1c57a3154
Added log statements in swift client

Added log statements in swiftclient/client.py:_retry where exceptions
are being raised.

Fixes bug# 1202229

Change-Id: I727537177849d08bb9603aa884152bdebc62fb85
python3: Start of adding basic python3 support.

Fix imports so its python3 compliant.

Change-Id: Ie08fe63b87e75bb099105ca1de860f9ab6c3340b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Refuse carriage return in header value"
Merge "python3: Start of adding basic python3 support."
fix(gitignore) : Ignore *.egg files

Change-Id: If52f9570a17230af9636f5337973e506c142b0bc
Move multi-threading code to a library.

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
Added headers argument support to get_object()

With this change conditional and range GETs are possible, as
documented in official API guide:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/retrieve-object.html

Change-Id: Ib2ed1c21e8d3f1ed79c0b7e542ee022ee535835c
Assignment to reserved built-in symbol "file"

In file: tests/test_swiftclient.py, test_unicode_ok() &
test_chunk_warning()

Fixes bug #1207736

Change-Id: I0a822802ec8910e9aec36ae5af775f8abb384d34
Merge "Added headers argument support to get_object()"