summaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Make bin/swift testable part 2Christian Schwede2014-03-251-0/+24
| | | | | | Follow up for patch https://review.openstack.org/#/c/76487/ Change-Id: I6801b75cb78a3da0631ca8a60b7c2756b8930e72
* Make bin/swift testable part 1Christian Schwede2014-03-251-1498/+0
| | | | | | | | | | | | | | | | | | | | | | 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
* Improve help stringsAndreas Jaeger2014-03-101-18/+18
| | | | | | | | Make help strings more consistent: * Fix wording and grammar, remove duplicated words * Add "." consistently everywhere. Change-Id: I37f94600df2a58532633f6bab2ab82fc5e91a75b
* add "info" as an alias to "capabilities"Clay Gerrard2014-03-061-1/+5
| | | | Change-Id: Ia07554250a6aae8f3a6be6a70f83690ec3fc108c
* Help string format persistentLuis de Bethencourt2014-02-261-50/+54
| | | | | | Keep the format of these strings constant through all options and commands. Change-Id: I67a47bdd5681b4b221baf55933a175568aa8e16d
* Make the help strings constantLuis de Bethencourt2014-02-261-42/+46
| | | | | | Have all the option help strinsg match the usage text for that command. Change-Id: I575a71769600f95c33cc4bbc9904b313f890e997
* Merge "Add missing backslash."Jenkins2014-02-181-2/+2
|\
| * Add missing backslash.Chmouel Boudjnah2014-02-051-2/+2
| | | | | | | | | | | | The one character commit of the day that needed two iterations. Change-Id: I3bfe91c7e164d45d03348b18e0a457314b8baec7
* | Merge "Add option to skip downloading/uploading identical files"Jenkins2014-02-181-7/+55
|\ \
| * | Add option to skip downloading/uploading identical filesChristian Schwede2014-02-111-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Port to python-requests"2.0Jenkins2014-02-141-7/+7
|\ \ \
| * | | Port to python-requestsTristan Cacqueray2014-02-121-7/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Rename Openstack to OpenStacktanlin2014-02-131-9/+9
| |/ |/| | | | | Change-Id: I091b1d2de41ff59b21ce136738e2f69b759d682b
* | Fix swiftclient helpChristian Schwede2014-02-071-16/+20
| | | | | | | | | | | | | | | | 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
* | Fix misspellings in python swiftclientShane Wang2014-02-071-1/+1
|/ | | | | | | | | Fix misspellings detected by: * pip install misspellings * git ls-files | grep -v locale | misspellings -f - Change-Id: I2fb042b3d9eb59cd404c52c775e5cc870e6157e1 Closes-Bug: #1257295
* Add capabilities optionFabien Boucher2014-01-171-1/+42
| | | | | | | | 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
* Merge "Add --object-name"Jenkins2013-12-251-11/+35
|\
| * Add --object-nameTaurus Cheung2013-12-241-11/+35
| | | | | | | | | | | | | | | | | | Add parameter --object-name, which: 1) Sets target object name when upload single file 2) Sets object prefix when upload a directory Change-Id: Idc4357c3355e66d31c100540b901e70db20b03c3 Closes-Bug: 1012979
* | Fix help of some optional argumentsSahid Orentino Ferdjaoui2013-12-181-4/+4
|/ | | | | | | | | | Some positional arguments are optional but the help indicate they are mendatory and can be confuse for an user. swift delete <container> [object] swift post <container> [object] Change-Id: I7be525905b51d3ef160b0f47194e817b5cba0f9b
* Fix download bandwidth for swift command.jola-mirecka2013-11-281-7/+13
| | | | | | | | | | | | | | | | 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 "Allow custom headers when using swift download (CLI)"Jenkins2013-11-271-1/+15
|\
| * Allow custom headers when using swift download (CLI)Matthieu Huin2013-11-041-1/+15
| | | | | | | | | | | | | | | | | | | | This fixes bug #1051046 A repeatable option, --header or -H, is added so a user can specify custom headers such as Range or If-Modified-Since when downloading an object with the swift CLI. Change-Id: I1f7dcf64cf625f2e5a4488c210894cfe6e0d5974
* | Merge "Add verbose output to all stat commands"Jenkins2013-11-211-120/+6
|\ \ | |/ |/|
| * Add verbose output to all stat commandsClay Gerrard2013-10-091-120/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix a typo in help text: "downlad"Romain Hardouin2013-10-271-1/+1
| | | | | | | | | | Change-Id: Icd6cf75f3c5758c13118060c19c9c000e28ef3ae Closes-Bug: #1245082
* | Merge "enhance swiftclient logging"Jenkins2013-10-181-5/+11
|\ \
| * | enhance swiftclient loggingLeah Klearman2013-10-171-5/+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
* | | Merge "Extend usage message for `swift download`"Jenkins2013-10-171-2/+4
|\ \ \
| * | | Extend usage message for `swift download`Alexis Lee2013-09-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it clear that you do not have to provide either the container or object positional parameters, and what swiftclient will do if you omit them. Change-Id: I3766fc1eabd51f197e2175771af579577a96c192
* | | | Merge "user defined headers added to swift post queries"Jenkins2013-10-171-0/+2
|\ \ \ \ | |_|/ / |/| | |
| * | | user defined headers added to swift post queriesMatthieu Huin2013-09-271-0/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | This commit fixes a problem where headers passed through the option --header were not taken into account when doing "post" queries. Change-Id: Ia34808c53a1816d9956a98e0803d8c4d20d2ad44 Closes-Bug: #1226256
* | | Clarify main help for post subcommandPete Zaitcev2013-10-141-1/+1
| | | | | | | | | | | | | | | | | | Fixes bug 1231321 Change-Id: I7014aa160ebe5ba0bc5a91de05e6858fc58f69e0
* | | Make pbr only a build-time dependency.Samuel Merritt2013-10-101-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | fix bug with replace old *LOsDavid Goetz2013-09-101-1/+1
|/ | | | Change-Id: I9e6278b62608cf36fa7e5e228f234cc8199c17fc
* Remove redundant unit suffixStanislaw Pitucha2013-08-281-1/+1
| | | | | | | Transfer speed already has a "MB/s" unit. The "s" suffix was probably a copy/paste mistake. Change-Id: Iccd7894d5ca11aac8a9f98365834c5d3deef0720
* Reformat help outputsJakub Krajcovic2013-08-191-70/+194
| | | | | | | | | | | Reformatted the help outputs in the swift client to bring them more in line with the rest of the openstack clients. Changes were added to all of the st_command_help variables and a new variable st_command_options was added to help with correct formatting of help outputs. Change-Id: I0c549cf96292384ddb36b43ecec41a883d8b2e13 Implements: changes to help outputs
* Move multi-threading code to a library.Darrell Bishop2013-07-281-394/+264
| | | | | | | | | | | | | | | | | | | | | | 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 "Allow setting # of retries in the binary"Jenkins2013-07-121-0/+3
|\
| * Allow setting # of retries in the binaryBen McCann2013-07-081-0/+3
| | | | | | | | Change-Id: I7ef4f1f86cc6ea4937043ea7bf7d9526e23bd2c7
* | Merge "Allow storage url override for both auth vers."Jenkins2013-07-101-4/+5
|\ \
| * | Allow storage url override for both auth vers.Darrell Bishop2013-07-051-4/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Note '-V 2' is necessary for auth 2.01.5.0Kun Huang2013-07-071-1/+2
|/ | | | | | | | | | Here are some questions in Launchpad, just because they miss '-V 2' for auth 2.0. https://answers.launchpad.net/swift/+question/231938 https://answers.launchpad.net/swift/+question/231279 So I add somethins for noteing people add the '-V 2' Change-Id: I2e0fef969be4eca316975de03fdbc516a1069acf
* Merge "Add -p option to download command."Jenkins2013-07-051-130/+151
|\
| * Add -p option to download command.Darrell Bishop2013-06-261-130/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the ability to download a subset of containers (--all with -p) or a subset of objects within a container (container name with -p). This patch also includes a drive-by fix for "download --all" which would not actually download any objects (for me, at least) because the object queue got filled with "stop" messages before the container workers had run long enough to put work in the object queue. Doh! I also closed up a few holes where an (unexpected, obviously) Exception could cause the process to hang because non-daemon threads still existed. Change-Id: I71c6935c60282b5353badc2dfce8a935d47e3bb7
* | add -t for totals to list command and --lh to statMark Seger2013-06-261-19/+50
|/ | | | Change-Id: Ieaba5e7762032bf9a2652ead39870d55e85b4672
* Merge "Add -l and --lh switches to swift 'list' command"Jenkins2013-06-111-6/+71
|\
| * Add -l and --lh switches to swift 'list' commandMark Seger2013-06-101-6/+71
| | | | | | | | | | | | | | Also updated man page and added an example in 'list' command help message Change-Id: Icf38de9bab6d387a9a1deed444a91f68b4389cfe
* | Add option to disable SSL compressionStuart McLaren2013-06-041-1/+7
|/ | | | | | | | | | | 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
* remove busy-wait so that swift client won't use up all CPU cyclesTong Li2013-05-291-117/+61
| | | | | | | | | | | | 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
* do not warn about etag for sloDavid Goetz2013-05-131-2/+4
| | | | Change-Id: I17fa1643f28aa1cd160c2d770243875a3c4a80ee