summaryrefslogtreecommitdiff
path: root/swiftclient
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Port to python-requests"2.0Jenkins2014-02-143-235/+114
|\
| * Port to python-requestsTristan Cacqueray2014-02-123-235/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Remove extraneous vim configuration commentsyangxurong2014-02-131-2/+0
| | | | | | | | | | | | | | | | | | Remove line containing comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 Change-Id: I31e4ee4112285f0daa5f2dd50db0344f4876820d Closes-Bug:#1229324
* | changed things because reasonsSergio Cazzolato2014-02-061-2/+5
|/ | | | | | | Dictionaries added in texts to improve readability in case there are 2 params Change-Id: I064cceeaa56b232504c6f0b6c215c9c5dbb7fcef
* Merge "Add capabilities option"Jenkins2014-01-311-0/+32
|\
| * Add capabilities optionFabien Boucher2014-01-171-0/+32
| | | | | | | | | | | | | | | | 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
* | match hacking rules in swiftJohn Dickinson2014-01-241-0/+13
| | | | | | | | Change-Id: Iee02978f38ca020754f52ceaed6aa3684fa87bc9
* | Merge "retry on ratelimit"Jenkins2014-01-181-1/+9
|\ \
| * | retry on ratelimitJohn Dickinson2013-12-231-1/+9
| |/ | | | | | | | | | | | | | | | | Added a retry_on_ratelimit parameter to the Connection class so that ratelimited requests can be retried. DocImpact Change-Id: I2817a7ea0ed2d69a7659e80111fbd2c91a75d530
* | Replace xrange in for loop with rangeWu Wenxiang2014-01-141-1/+1
|/ | | | | | | | | xrange is not supported in python 3, so replace it with range since no large size lists involved. Closes-Bug: #1237717 Change-Id: I4e5e0782153d32c8beee03f7d871722ed4352859
* Merge "Enable usage of proxies defined in environment (http(s)_proxy)."Jenkins2013-12-142-2/+58
|\
| * Enable usage of proxies defined in environment (http(s)_proxy).Davide Guerri2013-12-102-2/+58
| | | | | | | | | | | | | | | | | | As far as proxies usage is concerned, keystone-client API and swift-client API behave differently because the former uses python Request library while the latter uses raw httplib. As a result, Keystone authentication honors environment variables http_proxy, https_proxy and no_proxy while Swift doesn't. This patch, which code is mainly borrowed from Python Requests, makes Swift data connections and Swift authentication connections behaving homogeneously. Change-Id: Ic8a0089c35c458d7ed96e572e22429014298fe4c
* | Merge "Fixes python-swiftclient debugging message"Jenkins2013-12-121-1/+2
|\ \
| * | Fixes python-swiftclient debugging messageFlorent Flament2013-10-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Appends the container's name to the URL displayed, to be used to replay the queries with curl. Replaying the curl commands displayed by "swift --debug list <container>" now works properly. Example: $ swift --debug list test-container ... DEBUG:swiftclient:REQ: curl -i http://10.0.48.134:8080/v1/AUTH_6c554b8dd3d74e44878eddb92caf8687/test-container?format=json -X GET -H ... ... Change-Id: I7ec33d185fedc44a529c016d38f841fde39d20d0 Closes-Bug: #1238612
* | | Merge "Skip sniffing and reseting if retry is disabled"Jenkins2013-12-101-9/+8
|\ \ \
| * | | Skip sniffing and reseting if retry is disabledYuan Zhou2013-09-291-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bypass sniffing entirely if retries has been disabled. Fix bug #1216981 Change-Id: I593bdc56ca139af5a7f2ca2783ef2de2a96c94fb Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
* | | | Merge "Don't crash when header is value of None"Jenkins2013-12-071-1/+3
|\ \ \ \
| * | | | Don't crash when header is value of NoneChmouel Boudjnah2013-12-061-1/+3
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Fix download bandwidth for swift command."Jenkins2013-12-031-1/+3
|\ \ \ \
| * | | | Fix download bandwidth for swift command.jola-mirecka2013-11-281-1/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We noticed a difference in download bandwidth while using authentication details and pre-auth information for download. Download using authentication details included authentication time into the download bandwidth at each call of the function. This time should have been excluded from download bandwidth. This patch set is adding a timer variable to the client library. That allows to accurately measure and store the time of each action. Then while printing the download bandwith in the swift command authentication time is excluded from bandwidth. Change-Id: I63df9023e169f637f120ae9e25dac9c90a4e75a0 Fixes: bug #1197443
* | | | Merge "Add close to swiftclient.client.Connection"Jenkins2013-11-291-0/+8
|\ \ \ \ | |/ / / |/| | |
| * | | Add close to swiftclient.client.ConnectionFeng Liu2013-10-231-0/+8
| | | | | | | | | | | | | | | | Change-Id: I2f5fa9c46886607a9ba99e8915ea84ac4975d004
* | | | Merge "Add verbose output to all stat commands"Jenkins2013-11-213-0/+145
|\ \ \ \
| * | | | Add verbose output to all stat commandsClay Gerrard2013-10-093-0/+145
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Replaced two references to Cloud Files with SwiftAlex Gaynor2013-11-011-1/+1
| |/ / |/| | | | | | | | Change-Id: I721f2b25a255a829c625b34928b066df3cd3e632
* | | enhance swiftclient loggingLeah Klearman2013-10-171-9/+11
| |/ |/| | | | | | | | | | | | | | | | | * 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
* | Make pbr only a build-time dependency.Samuel Merritt2013-10-102-3/+14
|/ | | | | | | | | | | | | | This lets you build python-swiftclient packages that don't require pbr to be installed at all. You would need pbr on the machine running rpmbuild / debuild, but not on the machines that install the packages. Unfortunately, this does not make python-swiftclient able to be installed via pip 0.3.1 on Lucid; you'll need to uninstall the system python-pip package and install a new pip some other way. Given that pip < 1.3 doesn't perform SSL certificate validation for pypi (trivial MITM attack, anyone?), you'd probably want to get a new pip anyway. Change-Id: I85d4d77aacf094e48d39e48e750594b95dbc7af0
* Add a NullHandler when setting up library loggingClay Gerrard2013-08-171-0/+15
| | | | | | | | | | I was gunna write a test, but mocking ImportErrors is a PITA, so I decided to just get my tox py26 working instead. Tests seem to fail/pass as expected without/with the inline NullHanlder. Closes-Bug: 1212861 Change-Id: I20207374a77ee9969ab201c3a57e4caf40c02a61
* Merge "Added headers argument support to get_object()"Jenkins2013-08-021-4/+7
|\
| * Added headers argument support to get_object()Stanislav Vitkovskiy2013-07-291-4/+7
| | | | | | | | | | | | | | | | 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
* | Move multi-threading code to a library.Darrell Bishop2013-07-284-59/+315
|/ | | | | | | | | | | | | | | | | | | | | | This patch extracts the multi-threading code from bin/swift into swiftclient/multithreading and adds tests. In particular, this new way of doing it (with context managers) will prevent non-daemonic threads from wedging the process when unexpected exceptions happen. I enabled reporting of which lines, specifically, are not covered by unit tests (added -m option to "coverage report" in .unittests). This patch includes a drive-by fix for uploading a segmented file with --use-slo when that object already exists. A key of "name" was used instead of "path", raising KeyError. There's also another drive-by fix for uploading segmented objects with --use-slo. Commit 874e0e4427b80e1b15b74a1557b73ba9d61443ca regressed this by removing the capturing of thread-worker results in QueueFunctionThread.run(). This patch restores that functionality and the feature (uploading SLO objects). Change-Id: I0b4f677e4a734e83d1a25088d9a74f7d46384e53
* Merge "python3: Start of adding basic python3 support."Jenkins2013-07-231-1/+1
|\
| * python3: Start of adding basic python3 support.Chuck Short2013-07-181-1/+1
| | | | | | | | | | | | | | Fix imports so its python3 compliant. Change-Id: Ie08fe63b87e75bb099105ca1de860f9ab6c3340b Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Merge "Refuse carriage return in header value"Jenkins2013-07-231-2/+18
|\ \ | |/ |/|
| * Refuse carriage return in header valueKun Huang2013-07-121-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Added log statements in swift clientHemanth Makkapati2013-07-171-1/+5
| | | | | | | | | | | | | | | | | | Added log statements in swiftclient/client.py:_retry where exceptions are being raised. Fixes bug# 1202229 Change-Id: I727537177849d08bb9603aa884152bdebc62fb85
* | Update docstring for swiftclient.Connection.__init__Samuel Merritt2013-07-121-0/+2
| | | | | | | | | | | | | | There were two undocumented parameters in there, one introduced recently in 6411fd3, and the other some time before. Change-Id: I3a7d59e1c272b382b035b88ba5495bc1c57a3154
* | Adds max-backoff for retries in Connection.Mike Widman2013-07-121-4/+5
|/ | | | | | | | | | The max-backoff concept prevents the backoff used in _retry to double infinitely (which in turn causes wait times of an hour or more between retries). As per review, changed code to use min instead. Fixes: bug #1183542 Change-Id: Ic084f54069b7fa7a33604741487045c5e697ff06
* Allow storage url override for both auth vers.Darrell Bishop2013-07-051-19/+21
| | | | | | | | | | | | | | | | | | | | 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
* add optional 'response_dict' parameters to many calls into which they'llMark Seger2013-06-201-29/+120
| | | | | | return a dictionary of the response status, reason and headers Change-Id: I35f8824537f0484362dd6646c91789fac02fa075
* Fixes re-auth flow with expired tokens.EdLeafe2013-06-131-3/+5
| | | | | | | | | | The re-authentication of expired tokens assumed that the 401 would always occur on the first HTTP at tempt. This fix changes that so that re-auth is still only attempted once, but no longer has to be on the first attempt. Change-Id: I93a1187da3637287a803a59c146256d4f543c9d5 Fixes: bug #1131142
* Merge "Changed the call to set_tunnel to work in python 2.6 or python 2.7 ↵Jenkins2013-06-111-1/+6
|\ | | | | | | since its name changed between versions"
| * Changed the call to set_tunnel to work in python 2.6 or python 2.7 since its ↵Greg Lange2013-06-071-1/+6
| | | | | | | | | | | | name changed between versions Change-Id: I5550049435002b42c4fea06d41549a1e7254ac02
* | Add option to disable SSL compressionStuart McLaren2013-06-042-5/+121
|/ | | | | | | | | | | 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
* log get_auth request url instead of x-storage-urlLeah Klearman2013-05-221-1/+1
| | | | | | because if the request gets a 4xx error, then the url will be None, and that's just confusing. Change-Id: I62729364b9bd279498909dc5cd0d2a1ec5fcd70d
* Merge "Add end_marker and path query parameters"Jenkins2013-05-211-13/+29
|\
| * Add end_marker and path query parametersYUZAWA Takahiko2013-05-051-13/+29
| | | | | | | | | | | | Fix Bug 1175057 Change-Id: I1bf65fa7c4d99ddb03dd183fe3862df93455f501
* | Merge "Switch to pbr for setup."Jenkins2013-05-155-380/+2
|\ \
| * | Switch to pbr for setup.Monty Taylor2013-05-015-380/+2
| | | | | | | | | | | | Change-Id: Ifc2efa2bd7c2f030b51494ccb471f0c3e097c5ce
* | | Eradicate eventlet and fix bug lp:959221Pete Zaitcev2013-05-101-18/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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