* log to debug for successes and info for errors
* remove dead code, neither body or raw_body are sent in kwargs
* include resp.reason and response headers in logging
* remove trailing \n in logging. users who want them can set logging.basicConfig(format=FORMAT)
* add --info option to swift cli
Change-Id: If07af46cb377f3f3d70f6c4284037241d360a8b7
This lets you build python-swiftclient packages that don't require pbr
to be installed at all. You would need pbr on the machine running
rpmbuild / debuild, but not on the machines that install the packages.
Unfortunately, this does not make python-swiftclient able to be
installed via pip 0.3.1 on Lucid; you'll need to uninstall the system
python-pip package and install a new pip some other way. Given that
pip < 1.3 doesn't perform SSL certificate validation for pypi (trivial
MITM attack, anyone?), you'd probably want to get a new pip anyway.
Change-Id: I85d4d77aacf094e48d39e48e750594b95dbc7af0
This commit fixes a problem where headers passed through the option
--header were not taken into account when doing "post" queries.
Change-Id: Ia34808c53a1816d9956a98e0803d8c4d20d2ad44
Closes-Bug: #1226256
Specifically, removing d2to1 is the important part. While we're at it
though, use hacking to get the pyflakes/pep8 pins.
Change-Id: Ic4a43955526fcde313ad2f2afec8fafeb87f37a6
Make it clear that you do not have to provide either the container or
object positional parameters, and what swiftclient will do if you omit
them.
Change-Id: I3766fc1eabd51f197e2175771af579577a96c192
Reformatted the help outputs in the swift client to bring them more
in line with the rest of the openstack clients. Changes were added to
all of the st_command_help variables and a new variable
st_command_options was added to help with correct formatting of
help outputs.
Change-Id: I0c549cf96292384ddb36b43ecec41a883d8b2e13
Implements: changes to help outputs
I was gunna write a test, but mocking ImportErrors is a PITA, so I decided to
just get my tox py26 working instead. Tests seem to fail/pass as expected
without/with the inline NullHanlder.
Closes-Bug: 1212861
Change-Id: I20207374a77ee9969ab201c3a57e4caf40c02a61
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 log statements in swiftclient/client.py:_retry where exceptions
are being raised.
Fixes bug# 1202229
Change-Id: I727537177849d08bb9603aa884152bdebc62fb85
There were two undocumented parameters in there, one introduced
recently in 6411fd3, and the other some time before.
Change-Id: I3a7d59e1c272b382b035b88ba5495bc1c57a3154
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
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
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 the ability to download a subset of containers (--all with -p) or
a subset of objects within a container (container name with -p).
This patch also includes a drive-by fix for "download --all" which would
not actually download any objects (for me, at least) because the object
queue got filled with "stop" messages before the container workers had
run long enough to put work in the object queue. Doh!
I also closed up a few holes where an (unexpected, obviously) Exception
could cause the process to hang because non-daemon threads still
existed.
Change-Id: I71c6935c60282b5353badc2dfce8a935d47e3bb7
The re-authentication of expired tokens assumed that the 401 would
always occur on the first HTTP at tempt. This fix changes that so that
re-auth is still only attempted once, but no longer has to be on the
first attempt.
Change-Id: I93a1187da3637287a803a59c146256d4f543c9d5
Fixes: bug #1131142