| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Coverage for swiftclient.client is 71% with these tests.
Unit tests have been moved into another subdirectory
to separate them from functional tests.
Change-Id: Ib8c4d78f7169cee893f82906f6388a5b06c45602
|
|
|
|
|
|
|
|
|
| |
Some spots in this file were already referencing six.StringIO, but
some were still using StringIO.StringIO, which does not work on
py3. This patch just makes them all use six.StringIO and removes the
now-unused (and wrong, on py3) import.
Change-Id: I3c7311c3983f4eb409eedb6f85ede6ffe4059e63
|
|
|
|
|
|
|
|
|
| |
We were testing the test but we were not testing that we have actually
properly uploaded the object with the right content-len
(and it was broken under py3)
Change-Id: Ifa91c30532090cac9f8e18ff18eaf5e6c98737d1
|
|
|
|
|
|
| |
It wasn't used anymore since moved up to requests (and it fails in py3).
Change-Id: Ic8a80ae09ca6445696a9cf34ffb503c5ff51bc79
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Python 3, urllib.parse.quote() accepts bytes and str (unicode) types and
always return str (unicode).
Add also more tests with non-ASCII characters.
Change-Id: I8e0f19da7240e874392327d0da074ed4abb7d213
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change improves unit tests of the new code added by the port to requests.
Raw upload and chunked upload in put_object are now covered.
Change-Id: I995b23a74bc4b00bf5761362b1f1405bb8662311
|
|\ \ \
| |_|/
|/| | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
HTTP headers are encoded to bytes. Store headers at (key, value) tuples instead
of Unicode strings.
Check also that non-ASCII Unicode headers are encoded to UTF-8.
Change-Id: Ie45f5a5ba63f539a723a7ac5649779d8efb3e912
|
|\ \
| |/
|/| |
|
| |
| |
| |
| | |
Change-Id: Id6a31157582efe47cc3a74e6658679c2bec14767
|
|\ \
| |/
|/| |
|
| |
| |
| |
| | |
Change-Id: Ia67807667b4b5177d83cce9fcf16d98dc5024fbc
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Replace unicode with six.text_type
* Replace basestring with six.string_types
* The long type doesn't exist in Python 3 anymore: replace 1L with long(1) and
only test this type with Python 2
* Fix quote(): quote the URL if the string is a byte string. Use "bytes" type
instead of "str" to be Python 3 compatible.
Change-Id: I1df5aa85e4e7d07191fb5c654d52fc4bd8b9f440
|
|/
|
|
|
|
| |
Use six.moves to fix imports on Python 3.
Change-Id: I35b9405690e9f0607b24d79aa7c00830df954c41
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Keep Python 3.x compatibility
Change-Id: If7a8f0630bd2582ca9488313dcc59805c2ce1835
|
|
|
|
| |
Change-Id: Ibe76d98d6075b84cbdb370b48f3498ab848142ad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds a capabilities option on swiftclient.
This option uses the new /info endpoint to request the
remote capabilities and nicely display it.
Change-Id: Ie34b454511d5527e402e66e1fdb72120f427f2fd
|
|/
|
|
|
|
|
|
|
| |
Added a retry_on_ratelimit parameter to the Connection
class so that ratelimited requests can be retried.
DocImpact
Change-Id: I2817a7ea0ed2d69a7659e80111fbd2c91a75d530
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before commit 7d88d14d (http://git.io/hhJWdQ) swifclient used to accept
header value with the type None :
{'Headers': None}
It would just be happy with it with those None headers and not process
them, reinstate the old behavior.
Closes-Bug: 1256441
Change-Id: Ic7f80c38ef2ce9ef1687ed0d6d65521f2e754905
|
|\ \
| |/
|/| |
|
| |
| |
| |
| | |
Change-Id: I2f5fa9c46886607a9ba99e8915ea84ac4975d004
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When you stat a container or object with the verbose flag the full path of the
reousrce will be displayed with the token similarlly to how an account stat
displays the auth url and token.
* move some logic out of bin/swift.st_stat to test it
* new module swiftclient.commnad_helpers for code you want to test
* moved prt_bytes into swiftclient.utils to test it
* fixed IndexError with prt_bytes on sizes >= 1024Y
Change-Id: Iaaa96e0308b08c554205b0055b8a04de581fefa4
|
|/
|
|
|
|
|
|
|
|
| |
* log to debug for successes and info for errors
* remove dead code, neither body or raw_body are sent in kwargs
* include resp.reason and response headers in logging
* remove trailing \n in logging. users who want them can set logging.basicConfig(format=FORMAT)
* add --info option to swift cli
Change-Id: If07af46cb377f3f3d70f6c4284037241d360a8b7
|
|
|
|
| |
Change-Id: I75dac8693c079a153004f77dc1cda48f3ac6f51d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
With this change conditional and range GETs are possible, as
documented in official API guide:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/retrieve-object.html
Change-Id: Ib2ed1c21e8d3f1ed79c0b7e542ee022ee535835c
|
|/
|
|
|
|
|
|
|
| |
In file: tests/test_swiftclient.py, test_unicode_ok() &
test_chunk_warning()
Fixes bug #1207736
Change-Id: I0a822802ec8910e9aec36ae5af775f8abb384d34
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Fix imports so its python3 compliant.
Change-Id: Ie08fe63b87e75bb099105ca1de860f9ab6c3340b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See bug #1188896.
Comparing with Curl and Django, they both refuse carriage returns in
header values, so the request() method on the HTTP(S)Connection instance
returned by swiftclient.client.http_connection() will raise an
InvalidHeadersException if any of the headers to be sent contain a
newline.
Drive-by fix for a couple of header values which were integers instead
of strings (Content-Length getting set to zero).
Fixes bug #1188896
Change-Id: Ic6afdb92882284f843aacb06d20f682ddcb47151
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When --os-storage-url is specified on the command-line to bin/swift, it
will override the used storage URL regardless of authentication for both
authentication version 1 and version 2. This can be used to bypass a
load-balancer to hit a specific proxy server for testing/debugging
purposes.
Within the client library, this feature is accessed by passing the
desired storage URL into swiftclient.client.Conection.__init__() via the
os_options keyword argument. For example:
conn = Connection(auth_url, user, key, os_options={
'object_storage_url': 'http://overridden.storage.url/AUTH_foo'})
This patch also adds a dependency on mock>=0.8.0, which is the same as
openstack/swift.
Change-Id: Id2a36ed6abffd65e7762b6beea5bbfc6c036e848
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Fix Bug 1175057
Change-Id: I1bf65fa7c4d99ddb03dd183fe3862df93455f501
|
|
|
|
| |
Change-Id: Ib9ba1e7eed09c5a90c558a8365d0a87c3f4b5ee5
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Part of blueprint grizzly-testtools
Change-Id: Iff9aac184a115df9b396e218209962e6897a32d9
|
|
|
|
|
|
|
|
|
| |
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
|