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
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
Use mode "w" instead of the default mode "wb+" to get text file instead of
binary file on Python 3.
Change-Id: I2efe8d926309cfcd5ffe4ea963c11799773def73
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
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
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
Make help strings more consistent:
* Fix wording and grammar, remove duplicated words
* Add "." consistently everywhere.
Change-Id: I37f94600df2a58532633f6bab2ab82fc5e91a75b
urlparse netloc contains the TCP port if presents.
There is no need to provide conn.port when building
CLientException.
Change-Id: Id3e4fa8c4f4ab2ad693b0e8702ab69ed7c291830
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
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
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
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
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
* 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