277 Commits

Author SHA1 Message Date
Jenkins
cdf6f84c36 Merge "Python 3: Add six dependency" 2014-03-28 14:37:14 +00:00
Jenkins
b6ecec3cca Merge "Python 3: cast map() result to list" 2014-03-28 10:14:27 +00:00
Jenkins
14f0c89cc1 Merge "Python 3: Fix tests using temporary text files" 2014-03-28 10:14:26 +00:00
Jenkins
7dcefe1b64 Merge "Python 3: Replace iter.next() with six.next(iter)" 2014-03-28 09:59:03 +00:00
Victor Stinner
ac92c5cd7f Python 3: Add six dependency
Change-Id: I350eb089e02b4c33cf34c9fdb65289a2ad77f9c9
2014-03-28 09:25:11 +01:00
Victor Stinner
701faf0d16 Replace dict.iteritems() with dict.items()
dict.iteritems() has been removed in Python 3. In Python 2, dict.items()
creates a temporary list, but Samuel Merritt wrote:

"The size of the data is small enough that we don't need to worry about the
memory consumption; it's all just HTTP headers."

Change-Id: Iac427b8bbd032e4a1efb2bdc84a3968217eb6ddf
2014-03-27 12:21:25 +01:00
Victor Stinner
46d62bd9be Python 3: Replace iter.next() with six.next(iter)
Use six.next() to be Python 3 compatible.

Change-Id: Ia16148a759d368872787d5896a7b1dc42ffcdfb5
2014-03-27 12:13:49 +01:00
Christian Schwede
100419c0b3 Make bin/swift testable part 1
To make bin/swift importable for testing it needs to be renamed/moved.
The final idea is to move it to swiftclient/shell.py and add only a stub
in bin/swift to import swiftclient/shell.py.

However, doing this in a single step makes reviewing very hard, because
now there are > 1400 lines deleted from bin/swift and added to
swiftclient/shell.py - Gerrit doesn't detect the moved file.

For example: https://review.openstack.org/#/c/73710/2/

This patch first moves the code to swiftclient/shell.py and uses
setup.py/cfg to create the stub file in bin/swift. A follow up
(https://review.openstack.org/#/c/76489/) will then add the stub itself
in bin/swift (and remove the entry in setup.py).

The change to tox.ini is related to bug 1290562 and can be removed in
the future.

Change-Id: Id86392ccaf09e1d80a5d808fb49827d6d18c2588
2014-03-25 11:32:51 +00:00
Victor Stinner
9c85ea7a75 Python 3: Fix tests using temporary text files
Use mode "w" instead of the default mode "wb+" to get text file instead of
binary file on Python 3.

Change-Id: I2efe8d926309cfcd5ffe4ea963c11799773def73
2014-03-24 18:18:26 +01:00
Victor Stinner
6d5a4749b5 Python 3: cast map() result to list
On Python 3, map() returns a generator, not a list. Cast explicitly the result
of map() to a list to get a list on Python 2 and Python 3.

The cast is useless in Python 2, but it doesn't hurt performances: it's just a
unit test.

Change-Id: I87486b7dbc42507a6fd7886748a2e09735b6fc5b
2014-03-24 18:17:44 +01:00
Jenkins
070dd48c31 Merge "Copy Swift's .mailmap to swiftclient repo" 2014-03-21 08:16:48 +00:00
Jenkins
6be5c8cd77 Merge "Fix temporary pypy gate issue with setuptools" 2014-03-21 00:51:13 +00:00
Jenkins
8ff7d56037 Merge "Use six.StringIO instead of StringIO.StringIO" 2014-03-20 15:47:47 +00:00
Chmouel Boudjnah
7730a5d599 Fix temporary pypy gate issue with setuptools
Adding a fix proposed in bug 1290562 to avoid continuous gate failures
because of setuptools issue reported in the bug linked above.

Temporary Fixes-bug: #1290562

Change-Id: Ia8616d1939e664fc82de030b6384acb235e5c101
2014-03-19 10:27:19 +00:00
Samuel Merritt
19eb6d7dd7 Copy Swift's .mailmap to swiftclient repo
We had this before when swiftclient was in Swift's source tree, but it
didn't get copied over in the client extraction.

Change-Id: I218edcee265143164ea338e7ea95c19e72579925
2014-03-17 10:31:46 -07:00
Jenkins
d721dc7b61 Merge "Improve help strings" 2014-03-14 14:32:54 +00:00
Jenkins
41f5763b2b Merge "TCP port is appended two time in ClientException" 2014-03-12 02:13:18 +00:00
Andreas Jaeger
3dd9eddeb4 Improve help strings
Make help strings more consistent:
* Fix wording and grammar, remove duplicated words
* Add "." consistently everywhere.

Change-Id: I37f94600df2a58532633f6bab2ab82fc5e91a75b
2014-03-10 18:17:21 +01:00
Fabien Boucher
2e1a5b7e28 TCP port is appended two time in ClientException
urlparse netloc contains the TCP port if presents.
There is no need to provide conn.port when building
CLientException.

Change-Id: Id3e4fa8c4f4ab2ad693b0e8702ab69ed7c291830
2014-03-06 22:04:28 +01:00
Clay Gerrard
07dd668082 add "info" as an alias to "capabilities"
Change-Id: Ia07554250a6aae8f3a6be6a70f83690ec3fc108c
2014-03-06 13:01:49 -08:00
Jenkins
d2f3563cde Merge "Help string format persistent" 2014-03-06 00:57:16 +00:00
Jenkins
acfaed610c Merge "Make the help strings constant" 2014-03-06 00:54:36 +00:00
zhang-jinnan
26e644f7bb Use six.StringIO instead of StringIO.StringIO
Keep Python 3.x compatibility

Change-Id: If7a8f0630bd2582ca9488313dcc59805c2ce1835
2014-03-03 16:16:07 +08:00
OpenStack Jenkins
52893e3ce5 Merge "Updated from global requirements" 2.0.3 2014-02-27 04:53:09 +00:00
Jenkins
6cc1324e6e Merge "Add LengthWrapper in put_object to honor content_length param" 2014-02-27 04:52:59 +00:00
Jenkins
cfddbde81f Merge "swift.1 manpage fix for groff warnings" 2014-02-27 04:52:58 +00:00
Luis de Bethencourt
25a0e63619 Help string format persistent
Keep the format of these strings constant through all options and commands.

Change-Id: I67a47bdd5681b4b221baf55933a175568aa8e16d
2014-02-26 15:52:35 -05:00
Luis de Bethencourt
f2cd140ccd Make the help strings constant
Have all the option help strinsg match the usage text for that command.

Change-Id: I575a71769600f95c33cc4bbc9904b313f890e997
2014-02-26 15:52:35 -05:00
Clay Gerrard
3d35a3e989 Add LengthWrapper in put_object to honor content_length param
Closes-Bug:#1284360

Change-Id: Iec63a3fde77bb8195bfe46c764403b367999ff43
2014-02-25 01:12:51 -08:00
OpenStack Jenkins
f09abbf116 Updated from global requirements
Change-Id: I36af2ac149fe6b56ee3e0c54f13f1592c2f97343
2014-02-23 09:32:05 +00:00
Jenkins
f4e057923c Merge "Remove useless statement" 2014-02-19 23:17:10 +00:00
Fabien Boucher
b5b440d9b6 Remove useless statement
Change-Id: Ide74b417ede6a4976c33fc835d366ed472033fd0
2014-02-19 14:09:50 +01:00
Jenkins
21cec82ff1 Merge "Add missing backslash." 2014-02-18 06:24:59 +00:00
Jenkins
029ade17d2 Merge "Only run flake8 on swiftclient code" 2014-02-18 06:22:52 +00:00
Thomas Goirand
822274b637 swift.1 manpage fix for groff warnings
The current manual page contains hyphens where a minus sign
was intended. By default, "-" chars are interpreted as
hyphens (U+2010) by groff, not as minus signs (U+002D).
Since options to programs use minus signs (U+002D), this
means for example in UTF-8 locales that you cannot cut and
paste options, nor search for them easily.

This patch fixes this by escaping hyphens with backslashes,
and also fixes a typo: s/retreived/retrieved/.

Change-Id: If954c91eebe7b39bdac792f1f126998d2e3bcb8e
2014-02-18 11:42:18 +08:00
Jenkins
0aa0f4f6cc Merge "Add option to skip downloading/uploading identical files" 2014-02-18 01:45:54 +00:00
Tristan Cacqueray
380e830874 Remove multipart/form-data file upload
The requests 'files' parameter adds this 'Content-Type: multipart/form-data'
HTTP header and the whole multipart body data get stored with the object.
This also create a memory hog issue because files are loaded in memory before
being actually sent. This patch removes this behavior and restores what was
done before, ie: direct uploading.

This patches also fixes an issue in requests, when used with glance
CooperativeReader it mis-calculates content-length leading to chunked encoding
for raw upload.

Change-Id: Ie5b0a1078bedd33f09c6157f48b5f88116c589fa
Closes-Bug: #1280072
Closes-Bug: #1280275
2.0.2
2014-02-14 16:51:20 +01:00
John Dickinson
79f189a593 Fix --insecure option on auth
Change-Id: Ibe76d98d6075b84cbdb370b48f3498ab848142ad
2.0.1
2014-02-13 23:37:08 -08:00
Samuel Merritt
1bee485b36 Only run flake8 on swiftclient code
In particular, this skips the "build" directory, which is prone to
containing stuff that doesn't comply with all the hacking checks. The
actual code we care about all lives in three places, so let's only
check those.

Change-Id: I4a3be59913ad85a5a9e91d254f4d3f4b0b1cc7b7
2014-02-13 22:34:44 -08:00
Jenkins
19d7e1812a Merge "Port to python-requests" 2014-02-14 00:41:39 +00:00
Jenkins
0c7264c21d Merge "Remove extraneous vim configuration comments" 2014-02-13 20:20:32 +00:00
yangxurong
4e15bc7120 Remove extraneous vim configuration comments
Remove line containing

comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

Change-Id: I31e4ee4112285f0daa5f2dd50db0344f4876820d
Closes-Bug:#1229324
2014-02-13 17:44:29 +08:00
tanlin
c3107cd665 Rename Openstack to OpenStack
Change-Id: I091b1d2de41ff59b21ce136738e2f69b759d682b
2014-02-13 16:45:38 +08:00
Tristan Cacqueray
b182112719 Port to python-requests
Currently, httplib implementation does not support SSL certificate
verification. This patch fixes this. Note that ssl compression parameter
and 100-continue thing is still missing from requests, though those are
lower priority.

Requests now takes care of:
* proxy configuration (get_environ_proxies),
* chunked encoding (with data generator),
* bulk uploading (with files dictionary),
* SSL certificate verification (with 'insecure' and 'cacert' parameter).

This patch have been tested with requests 1.1.0 (CentOS 6) and requests
2.2.1 (current version).

Change-Id: Ib5de962f4102d57c71ad85fd81a615362ef175dc
Closes-Bug: #1199783
DocImpact
SecurityImpact
2014-02-12 13:21:26 +01:00
Christian Schwede
9b3ec3705f Add option to skip downloading/uploading identical files
swift has already the upload option "--changed" to upload only changed
files. This patch adds a similar feature by comparing the md5 of the
local file to the remote object etag.

When used in combination with download the MD5 hexdigest of each file
is sent with an "If-None-Match" header to skip downloading identical files.

When used in combination with upload the MD5 is compared to the remote
etag by using the already existing HEAD request.

Change-Id: I727b0456558c6a7742b2428c6d1c45c4bfaf66e9
2014-02-11 09:13:26 +00:00
Jenkins
f13288ae32 Merge "Fix swiftclient help" 2014-02-10 21:51:58 +00:00
Jeremy Stanley
ef814bdf51 Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: If4e025e22248d06b77e9d4d8f4e4815776428b9d
Closes-Bug: #1277495
2014-02-10 03:11:19 +00:00
Christian Schwede
545ea2e032 Fix swiftclient help
Command help was wrong in some cases. While we're at it, add some
defaults to help and change some brackets to be consistent with
http://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax

Change-Id: I5d7b2a703294d97fc5e3de43b9ec375c3ea55a6e
2014-02-07 13:48:51 +00:00
Shane Wang
0d3f4a0aa2 Fix misspellings in python swiftclient
Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: I2fb042b3d9eb59cd404c52c775e5cc870e6157e1
Closes-Bug: #1257295
2014-02-07 13:58:17 +08:00
Sergio Cazzolato
d387c61daa changed things because reasons
Dictionaries added in texts to improve readability in case there
are 2 params

Change-Id: I064cceeaa56b232504c6f0b6c215c9c5dbb7fcef
2014-02-06 17:31:32 -08:00