The bug is simple: whenever swift uploads to a Swift with SSL,
it uses 100% CPU. It happens because we use HTTPSConnection from
eventlet that loops like that, while holding the interpreter lock.
Now, it could be fixed in eventlet, but let's try something more
natural: drop the eventlet's HTTP client. We do not use green
threads in the client anymore, so it's not like we need it for that.
Note that in most cases clients do not use the BufferedHTTPConnection
either, because it's only installed on Swift server nodes, not on
workstations. Get rid of that too.
bug: 959221
Change-Id: I1eb932779d4171598b3efaa043f817b9c6c995c4
Some mechancical replacement of the deprecated except x,y:
construct with except x as y, which works with any Python
version >= 2.6
Change-Id: Ic245049dc7b408a5c89b9e27dfd2bd7c08acc5b5
If you use the API and supply only preauth values (preauthurl and
preauthtoken), and if either of these are incorrect, a non-descriptive
AttributeError will be thrown and uncaught:
'NoneType' object has no attribute 'find'
The _retry() will fail on the first pass (getting 401), then try
to reauthenticate with non-preauth values. If those are not given,
particularly the auth url, then the urlparse() call will be supplied
None for the url in http_connection() causing the exception above.
This change makes sure that we have an auth url, user and key before
retrying authentication. Given the situation above, a '401 Unauthorized'
ClientException will now be thrown instead of the AttributeError.
Change-Id: Ie1b5bde1e8ff321aa18c0f23dbd2960d6e482236
Add to the help strings to clarify the need for --os-auth-token to
also have --os-storage-url supplied.
Change-Id: I6a7259c38ce01813ae96f307efaf46e7863bd223
Also fixed bug with current large objects with segment listing prefixes.
Allow retry for object PUTs when possible.
Change-Id: I0edff127fd5d5c53da33aa7cb76a4f4dc85bf6e6
Files test_swiftclient.py and utils.py had all pep8 errors
fixed.
Also added tests directory to tox.ini file, so that
pep8 would monitor tests directory by default.
Change-Id: Id60a2cd88bd814d1dcbeca951764c9d236500837
Fixes: bug #1158819
Currently swift client does not allow content type to be specified
when upload an object. It does not allow a user to change content
type neither. This patch will allow a user to specify content
type by using upload command or modify the content type by using
post command.
For example:
1. To upload an object with specific content type:
swift upload -H content-type:applicaiton/xml con1 file1
2. To modify an object to a specific content type:
swift post -H content-type:application/josn con1 file1
This patch also allow a client to specify other request headers.
Change-Id: I12db83a1d465285e0906889cc67dfaa44e059568
Fixes: bug #1154621
Changed documentation for chunk_size parameter to indicate
that it can be used only with file like objects.
Also added a UserWarning when using a string contents to inform
that chunk_size will be ignored.
Added a unit test to check whether the warning is working
correctly.
Fixes: bug #1147232
Change-Id: I618ec45520ba81905ce2ead4d61f192d21ae3489
This is the byte-by-byte copy of swift.1 that was left behind
in the main Swift package when python-swiftclient was split away.
Apparently there is absolutely nothing to be changed in setup.py
and the distribution packagers are supposed to pick the page as-is
using their packaging systems.
Change-Id: I24f238501589db940574eac61b89a1422fe2fd77
Fix bug 1110924
Add segment container option as part of 'swift upload -S'. If this
option is omitted, the segments will go to <container>_segments.
Example:
$ swift upload c1 obj1 -S 1 -C user_segments
Please check swift upload --help for more details
Change-Id: Ib71aae322485d8d3ac89916d37ebcac053f49e3b
client.py now prints a useful message when trying to use Auth version
2.0 and keystoneclient is not installed.
Fixes bug 1102322
Change-Id: I6ed83610fd6e8c79c2dc5cf05db377a843cab1d5
nose is invasive and can sometimes alter the outcome of a test run. testr,
on the other hand, keeps a distinction between running tests and displaying
results of the test runs. Additionally, it supports the stock python unittest
protocol.
Even better, testr supports parallel test running, which makes things faster,
and a command "testr run --failing" which will just re-run the latest failing
tests (often something one wants to do in iterative dev)
Part of blueprint grizzly-testtools
Change-Id: I0b3f1bcb5d4ff59c65eb3219b30a9e64f54d70bd
Add env[SWIFTCLIENT_INSECURE] as default of --insecure option.
If set to 'true', allow to access insecure keystone server.
The name follows 'NOVACLIENT_INSECURE' in novaclient.
Change-Id: I322674eba9c07e6def97bce339815fa15191a92d
- Remove PYTHON_SWIFTCLIENT and use --debug making it more consistents
with other openstack clients libraries.
- Fix printing the curl command.
- Don't show the body of the GET objects it could get bad on large
objects and it's an iterator anyway.
- Use -I for showing HEADs (and not -X HEAD).
Change-Id: I954e7d3d795401fc3679725440dec36cdc80af87
Add support to specify a ca certificate bundle to verify
keystone TLS (https) certificates. This only verifies
certificates on the keystone connection, swift https
connections are unchanged.
Change-Id: I14351b405af4fd3d1970ba6656c1282a5d0a1082
If enable this option , swift CLI is allowed to access a keystone
server with self signed certificate.
Change-Id: I5e219fe875b246b68ac51a077e7ff15e95463adf
Adding a trailing slash to the authentication URL may interfere with
auth service implementations not using /FOO/ but /FOO as authentication
URL.
OpenStack Object Storage API 1.0 doesn't specify that the auth URL must
end in a slash and swiftclient.client doesn't force it either.
Change-Id: I4e6b6d758d5ccc884e253880513e3d8763ffc2ff
Fixes: bug #1085827
str(float) isn't a good way of converting a float to a string with all the precision
Eg
>>> f = os.path.getmtime("z")
>>> f
1347717491.343554
>>> str(f)
'1347717491.34'
>>> "%f" % f
'1347717491.343554'
Change-Id: I6eb02f7f6730eff814c348d1039eae4606642b52