133 Commits

Author SHA1 Message Date
Stuart McLaren
790f087a67 Add option to disable SSL compression
Allows optionally disabling SSL compression. This can significantly
improve HTTPS upload/download performance in some cases -- in particular
when the object is not compressible and you have very high network
bandwidth.

Implements blueprint ssl-compression.

Change-Id: I1260055f9c2e83cdabfeb51aed11b3899bed4d55
2013-06-04 16:33:18 +00:00
niu-zglinux
2d12f09c66 Rename requires files to standard names.
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.

Change-Id: I9c1356f22f6527be44b4b3f6a77012156ff1637b
Fixes: bug #1179008
2013-05-30 22:14:28 +00:00
Tong Li
874e0e4427 remove busy-wait so that swift client won't use up all CPU cycles
The current implementation uses busy-wait and checking flags to
communicate between threads. It wastes a lot of CPU powers. With
python 2.6 is required for Swift, the communication between
threads should now be using queue and signal mechanisms. This
patch removed the busy-wait loops and use queue and queue join
for threads coordination which will not consume CPU cycles if
a thread is blocked.

Change-Id: I648cd637a92a159d5c13baa83f357cee2dfe7937
2013-05-29 19:09:49 +00:00
Leah Klearman
7e84b69291 log get_auth request url instead of x-storage-url
because if the request gets a 4xx error, then the url will be None, and that's just confusing.

Change-Id: I62729364b9bd279498909dc5cd0d2a1ec5fcd70d
2013-05-22 18:17:59 -07:00
Pete Zaitcev
07311a0639 Update the man page
- Add -V option
- Use uniform and correct capitalization for OpenStack Swift
- Make the example of output of stat command up-to-date
- Generally prettify the document
- Remove all trailing whitespace

Change-Id: Id3da2035851847c4bff8cec8f927d3654824bf5b
2013-05-21 15:34:21 -06:00
Jenkins
d5b6d29a30 Merge "Add end_marker and path query parameters" 2013-05-21 04:29:55 +00:00
Jenkins
feec0c83ac Merge "do not warn about etag for slo" 2013-05-21 04:17:52 +00:00
Jenkins
7391fcc45e Merge "Add .coveragerc file to show correct code coverage" 2013-05-16 15:30:29 +00:00
Vasyl Khomenko
541d805b66 Add .coveragerc file to show correct code coverage
Change-Id: I428d0c2587cc480a27796c5fa246b171606809e1
2013-05-16 01:24:33 -07:00
Jenkins
af4109dd56 Merge "Switch to pbr for setup." 2013-05-15 08:15:39 +00:00
David Goetz
adebab739d do not warn about etag for slo
Change-Id: I17fa1643f28aa1cd160c2d770243875a3c4a80ee
2013-05-13 07:37:15 -07:00
Pete Zaitcev
3196daf992 Eradicate eventlet and fix bug lp:959221
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
2013-05-10 21:33:17 -06:00
YUZAWA Takahiko
073cd56218 Add end_marker and path query parameters
Fix Bug 1175057

Change-Id: I1bf65fa7c4d99ddb03dd183fe3862df93455f501
2013-05-05 20:52:02 +09:00
Jenkins
fcb3100b7d Merge "Confirm we have auth creds before clearing preauth" 2013-05-02 18:36:24 +00:00
Monty Taylor
50f32bc803 Switch to pbr for setup.
Change-Id: Ifc2efa2bd7c2f030b51494ccb471f0c3e097c5ce
2013-05-01 12:23:12 -04:00
Monty Taylor
1eb2c29856 Switch to flake8.
Change-Id: Ib9ba1e7eed09c5a90c558a8365d0a87c3f4b5ee5
2013-05-01 12:23:01 -04:00
Dirk Mueller
000e33d021 Improve Python 3.x compatibility
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
2013-04-29 11:08:47 +02:00
David Shrewsbury
9aa52eecb5 Confirm we have auth creds before clearing preauth
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
2013-04-25 07:43:43 -04:00
Jenkins
2d97609a52 Merge "Static large object support." 2013-04-04 23:08:25 +00:00
Dean Troyer
fab61c8275 Improve auth option help
Add to the help strings to clarify the need for --os-auth-token to
also have --os-storage-url supplied.

Change-Id: I6a7259c38ce01813ae96f307efaf46e7863bd223
2013-04-04 15:41:22 -05:00
David Goetz
2b3d171907 Static large object support.
Also fixed bug with current large objects with segment listing prefixes.

Allow retry for object PUTs when possible.

Change-Id: I0edff127fd5d5c53da33aa7cb76a4f4dc85bf6e6
2013-04-03 09:51:15 -07:00
jola-mirecka
8ea9c4aae8 Fixed pep8 errors in test directory.
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
2013-03-22 15:00:40 +00:00
Jenkins
4f57f815b3 Merge "Enhance put_object to inform when chunk is ignored" 2013-03-22 10:00:47 +00:00
Jenkins
42fa4568f1 Merge "Allow user to specify headers at the command line." 2013-03-21 11:11:50 +00:00
Jenkins
f31916051d Merge "Allow v2 to use storage_url/storage_token directly" 2013-03-19 18:36:04 +00:00
tong li
48f446a938 Allow user to specify headers at the command line.
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
2013-03-18 09:48:33 -04:00
jola-mirecka
d90b768e50 Enhance put_object to inform when chunk is ignored
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
2013-03-06 15:38:50 +00:00
Jenkins
999e1c0f02 Merge "Added "/" check when list containers." 2013-02-28 02:58:28 +00:00
Jenkins
974f530bdb Merge "Allow to specify segment container" 2013-02-27 22:08:34 +00:00
Chmouel Boudjnah
45af829aa5 Allow v2 to use storage_url/storage_token directly
- Fixes bug 1134306.

Change-Id: Ie1737c57f57bcdad50b3096c921d46a1fe5293b8
2013-02-27 13:55:05 +01:00
Pete Zaitcev
d79c435bfe Add client man page swift.1
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
2013-02-26 12:47:34 -07:00
yuan-zhou
9ac2c99fc6 Allow to specify segment container
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
2013-02-26 11:09:34 +08:00
Jian Zhang
ec38637a35 Added "/" check when list containers.
If there is a "/" in container name, print usage.

Fixs bug 1121897.

Change-Id: I633b5b7ff3a8dbc249ddd3c65439dd46c7d93b4a
2013-02-24 19:10:53 -08:00
Flaper Fesp
4ac431a9a2 Print useful message when keystoneclient is not installed
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
2013-02-05 10:13:56 +01:00
Jenkins
b5f222b5d6 Merge "Use testr instead of nose." 2013-01-30 21:56:29 +00:00
Jenkins
8298803091 Merge "Fix reporting version." 2013-01-30 20:53:33 +00:00
Chmouel Boudjnah
9a484dfd63 Fix reporting version.
- Fixes bug 1102691.

Change-Id: I72749a1c87a1f337b45d193e923b437d12270b05
2013-01-22 16:32:50 +01:00
Jenkins
bf09dd9573 Merge "Update to latest oslo version/setup." 2013-01-21 21:50:21 +00:00
Jenkins
c194266096 Merge "Add generated files to .gitignore." 2013-01-21 21:19:12 +00:00
Monty Taylor
bfeffb6366 Use testr instead of nose.
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
2013-01-18 16:13:27 -05:00
Monty Taylor
8b80285da6 Update to latest oslo version/setup.
Change-Id: I7bd38b950ef9fea8b6eaa1df599085a1c64d8b61
2013-01-14 03:29:22 -08:00
Jenkins
3d04363ba4 Merge "Add env[SWIFTCLIENT_INSECURE]" 2013-01-10 20:10:30 +00:00
Monty Taylor
1aa712eaf2 Add generated files to .gitignore.
Change-Id: I609b98d3ffe576313d3206925a03b1657d3fbce9
2013-01-10 08:45:26 +00:00
You Yamagata
5edb40b442 Add env[SWIFTCLIENT_INSECURE]
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
2013-01-10 13:26:53 +09:00
Chmouel Boudjnah
ab4282ebb4 Fix debug feature and add --debug to swift.
- 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
2013-01-07 17:59:12 +01:00
Monty Taylor
e93d47a930 Use testtools as base class for test cases.
Part of blueprint grizzly-testtools

Change-Id: Iff9aac184a115df9b396e218209962e6897a32d9
2012-12-26 09:36:07 -06:00
Dean Troyer
f65f96bc59 Add --os-cacert
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
2012-12-20 14:03:19 -06:00
Jenkins
7df9cadbf0 Merge "Add --insecure option to fix bug #1077869" 2012-12-09 09:19:33 +00:00
Jenkins
1662cbd0a3 Merge "Don't add trailing slash to auth URL." 2012-12-06 01:45:16 +00:00
You Yamagata
6a4dc039ff Add --insecure option to fix bug #1077869
If enable this option , swift CLI is allowed to access a keystone
server with self signed certificate.

Change-Id: I5e219fe875b246b68ac51a077e7ff15e95463adf
2012-12-05 13:26:37 +09:00