OpenStack Storage (Swift) Client
Go to file
Zack M. Davis 5ae4b42392 make ClientException.http_status default to None rather than 0
The extant default of zero is a bit counterintuitive;
insufficiently-careful programmers using swiftclient in their
application might, without carefully reading the source or
documentation, write buggy code based on the assumption that the
`http_status` attribute is absent or defaults to None if ClientException
is raised for reasons other than to indicate an unsuccessful HTTP
request. (However improbable this scenario may seem, the present author
can sadly attest to it having actually happened at least once.)

Just changing the default would break some tests on Python 3, due to the
`500 <= err.http_status <= 599` comparison in Connection's _retry
method (NoneType and int are not orderable in the Python 3.x series);
thus, the case where http_status is None is explicitly folded into a
code branch that logs and reraises (whereas previously it would have
fallen through to an `else` branch where it would be logged and reraised
just the same).

While we're here, we might as well make ClientException's __init__ use
super() (although admittedly the kinds of multiple-inheritance scenarios
in which `super` truly shines seem unlikely to occur here).

Change-Id: I8c02bfb4a0ef059e781be5e08fcde13fb1be5b88
2015-09-04 16:24:54 -07:00
bin Make bin/swift testable part 2 2014-03-25 11:36:39 +00:00
doc add tempurl command to swift.1 man page 2015-07-13 11:38:58 -07:00
swiftclient make ClientException.http_status default to None rather than 0 2015-09-04 16:24:54 -07:00
tests Merge "Log and report trace on service operation fails" 2015-09-04 01:46:18 +00:00
.coveragerc Add .coveragerc file to show correct code coverage 2013-05-16 01:24:33 -07:00
.functests Fix running the unittests under py3 2014-05-09 09:29:04 +02:00
.gitignore Add a tox job for generating docs 2014-07-24 17:54:10 -04:00
.gitreview Add openstack project infrastructure. 2012-05-16 17:30:46 -04:00
.mailmap Copy Swift's .mailmap to swiftclient repo 2014-03-17 10:31:46 -07:00
.testr.conf Fix running the unittests under py3 2014-05-09 09:29:04 +02:00
.unittests Add functional tests for python-swiftclient 2014-05-05 11:53:37 +02:00
CONTRIBUTING.md Workflow documentation is now in infra-manual 2014-12-05 15:32:57 +11:00
LICENSE Add CHANGELOG LICENSE and MANIFEST.in 2012-05-08 16:30:13 +01:00
MANIFEST.in Switch to pbr for setup. 2013-05-01 12:23:12 -04:00
README.rst Workflow documentation is now in infra-manual 2014-12-05 15:32:57 +11:00
requirements.txt Remove simplejson dependency 2015-05-20 18:14:53 -07:00
run_tests.sh Add run_tests.sh script here. 2012-05-21 12:52:55 +02:00
setup.cfg Adds console script entry point 2014-08-21 01:01:24 +03:00
setup.py Sync with global requirements 2013-09-13 11:02:05 -05:00
test-requirements.txt Update mock to get away from env markers 2015-08-06 14:51:10 -07:00
tox.ini Drop flake8 ignores for already-passing tests 2015-08-19 14:54:03 -07:00

Python bindings to the OpenStack Object Storage API

This is a python client for the Swift API. There's a Python API (the swiftclient module), and a command-line script (swift).

You can find the documentation online.

Development takes place via the usual OpenStack processes as outlined in the OpenStack wiki. The master repository is on GitHub.

This code is based on original the client previously included with OpenStack's swift The python-swiftclient is licensed under the Apache License like the rest of OpenStack.

Contents: