summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix context sensitive help for info and tempurl2.2.0Alistair Coles2014-07-212-22/+31
| | | | | | | | | | Make it so that swift <cmd> --help will print the info subcommand help for info and tempurl just like all the other subcommands. Also add unit tests to verify subcommand help. Change-Id: Id3666dcf72a9727fbfda2f74c23293ada1c53aa0
* Merge "Allow to specify storage policy when uploading objects"Jenkins2014-07-212-8/+55
|\
| * Allow to specify storage policy when uploading objectsYuan Zhou2014-07-172-8/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Client already supports -H/--header option when creating container or uploading objects. This patch extends this option to support Storage Policy. e.g., swift post con -H 'X-Storage-Policy:p1' This creates one container 'con' with storage policy 'p1'. swift upload con obj -H 'X-Storage-Policy:p2' This creates container 'con' with storage policy 'p2' and uploads object 'obj' into it. Also fixes segmented uploading to non-default storage policy container When uploading large objects with segmentation to container with non-default storage policy, there will be another 'xxx_segments' container created, but with the default storage policy. This results all the segments to be stored with the wrong policy. This patch is for the Storage Policy feature, and also compatible with old versions w/o Storage Policy support. Change-Id: I5c19e90604a0bcf2c85e1732b8a0b97ae6801994
* | Merge "Adding Swift Temporary URL support"Jenkins2014-07-184-2/+145
|\ \ | |/ |/|
| * Adding Swift Temporary URL supportJosh Gachnang2014-07-114-2/+145
| | | | | | | | | | | | | | | | | | | | Temporary URLs allow a user to sign an object URL with a shared secret to so that the object can be downloaded without auth for a specified amount of time. http://docs.openstack.org/trunk/config-reference/content/object-storage-tempurl.html Change-Id: Ife0b6c98c975e074d4dad0a31145573b784747c5
* | Merge "replace string format arguments with function parameters"Jenkins2014-07-111-2/+2
|\ \
| * | replace string format arguments with function parametersChristian Berendt2014-06-031-2/+2
| |/ | | | | | | | | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: I90270908d27f0a57c184d5a547bb1af9b1381c95
* | Merge "Add context sensitive help"Jenkins2014-07-091-1/+22
|\ \
| * | Add context sensitive helpMark Seger2014-06-251-1/+22
| |/ | | | | | | Change-Id: I9aaadbaba2c43a12a83f8200eaaa96f48c52028e
* | Merge "Removed now unnecesary workaround for PyPy"Jenkins2014-07-081-5/+0
|\ \
| * | Removed now unnecesary workaround for PyPyAlex Gaynor2014-05-311-5/+0
| |/ | | | | | | Change-Id: I7bf6346edc399ec29b125b50eb7ac2cfbb87cdfa
* | Add CONTRIBUTING.mdliuqing2014-07-031-0/+13
| | | | | | | | | | | | There is no CONTRIBUTING.md file, the patch will add it. Change-Id: Idc0a9ae22f2b315375b660263c7602e3ca02d56b
* | Relax requirement for tenant_name in get_auth()anc2014-06-052-3/+21
|/ | | | | | | | | | | get_auth() in client.py raises an exception if tenant_name is not included in the os_options dict. This is overly constrained since tenant_id is equally sufficient. This patch modifies get_auth to require either tenant_name or tenant_id. Change-Id: Ibbcda1704637eb887efa5895579d260a1e072327
* Merge "change assertEquals to assertEqual"Jenkins2014-05-281-4/+4
|\
| * change assertEquals to assertEqualChristian Berendt2014-05-141-4/+4
| | | | | | | | | | | | | | According to http://docs.python.org/2/library/unittest.html assertEquals is a deprecated alias of assertEqual. Change-Id: Ibf4d548b86c53f30830b7e34b019fa8f67997cd8
* | Use Emacs-friendly coding line.Martin Geisler2014-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To signal the file encoding to Emacs, one can add a line with -*- coding: your-favority-encoding -*- Python also understands such a line, infact it also understands the line if it says "encoding" instead of "coding". However, it is only "coding" that has an effect in Emacs. Furthermore, since "encoding" is not recognized, Emacs will prompt the user with a scary looking message when the file is opened: The local variable list in __init__.py contains values that may not be safe. Using the correct variable name fixes this. (The file contain only ASCII characters at the moment, so the line could alternatively be removed completely.) Change-Id: Ie6b4f41043bf97bb59e3de403e4794c302d81783
* | Remove extra double quote from docstringMartin Geisler2014-05-261-1/+1
| | | | | | | | | | | | | | | | The extra " was visible on http://docs.openstack.org/developer/python-swiftclient/swiftclient.html Change-Id: I7d61c8259a4f13464c11ae7e3fa28eb3a58e4baa
* | Merge "fixed several pep8 issues"Jenkins2014-05-243-39/+39
|\ \
| * | fixed several pep8 issuesChristian Berendt2014-05-213-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * E111 indentation is not a multiple of four * E128 continuation line under-indented for visual indent * E265 block comment should start with '# ' * E713 test for membership should be 'not in' Tested with pep8 version 1.5.6 (2014-04-14). Change-Id: I7f85c143d463c501a0df20724362ad5c0f2d4dde
* | | Merge "Remove testtools.main() call from tests"Jenkins2014-05-243-13/+0
|\ \ \
| * | | Remove testtools.main() call from testsChristian Schwede2014-05-203-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no testtools.main() at all (this was a unittest.main() before). Let's remove this unused and non-working code. The following code can be used if someone needs to start tests manually: python -m unittest <test_file.py> Change-Id: Id5162ac73825584df6c23dbe68786ff3355fc6ae
* | | | Fix wrong assertions in unit testsanc2014-05-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of assertTrue in the test_swiftclient.py unit tests should be assertEqual. Also, the expected values now need to be bytes literals. Change-Id: I7cc1bd60d9ba82d1a28fbae2e1243d3c799451bd
* | | | Fix Python3 bugs2.1.0Christian Schwede2014-05-213-9/+30
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes three issues that were found running functional tests with Python 3: 1. python-requests sets 'application/x-www-form-urlencoded' as content-type if the input is not a string object and no content-type is given. 2. Encoding of the headers is now only done if required. This prevents comparisons between unencoded headers and encoded prefixes and avoids unnecessary forloop-iterations. One unittest was extended to ensure it works for unencoded and encoded headers with or without the prefix. 3. Functional tests recently switched to using byte data for testing, thus the comparison needs to be a byte object as well. Change-Id: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
* | | Move test_shell.py under tests/unit/anc2014-05-201-0/+0
|/ / | | | | | | | | | | | | | | | | Looks like test_shell.py got left behind when the unit tests were relocated under tests/unit. As a consequence they weren't included in tox runs. Change-Id: I93435e6141c5e3ad4a9403626f226d7c760cbd7c
* | Merge "Mark swiftclient as being a universal wheel"Jenkins2014-05-161-0/+3
|\ \
| * | Mark swiftclient as being a universal wheelAlex Gaynor2014-05-161-0/+3
| | | | | | | | | | | | Change-Id: I9580ab0f5bc53b472d0b633858090f9e0708ed90
* | | Merge "change assert_ to assertTrue"Jenkins2014-05-161-1/+1
|\ \ \
| * | | change assert_ to assertTrueChristian Berendt2014-05-141-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | According to http://docs.python.org/2/library/unittest.html assert_ is a deprecated alias of assertTrue. Change-Id: I18db0af72934dde4498502fb29579941d020cf01
* | | Merge "fixed typos found by RETF rules"Jenkins2014-05-162-5/+5
|\ \ \ | |_|/ |/| |
| * | fixed typos found by RETF rulesChristian Berendt2014-05-122-5/+5
| | | | | | | | | | | | | | | | | | rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos Change-Id: I98b6e46cb84962ffdac02e9007b5ad3b30bc2817
* | | Merge "Provide a link to the documentation to the README"Jenkins2014-05-151-0/+4
|\ \ \
| * | | Provide a link to the documentation to the READMEAlex Gaynor2014-05-131-0/+4
| | |/ | |/| | | | | | | Change-Id: I99a46860ffff93452904d24504a4ccc58e8e64c6
* | | Merge "Declare that we support Python 3"Jenkins2014-05-151-0/+2
|\ \ \ | |/ / |/| |
| * | Declare that we support Python 3Alex Gaynor2014-05-081-0/+2
| |/ | | | | | | | | | | | | Note that this should not land until we figure out why `tox -e py33` doesn't actually run any tests. Change-Id: Id4e080cfbfca45b3bf7ed81b03a31414495a1348
* | Merge "Add "." for help strings"Jenkins2014-05-131-8/+8
|\ \
| * | Add "." for help stringsAndreas Jaeger2014-05-081-8/+8
| |/ | | | | | | | | | | | | | | | | The command descriptions did not include a "." at the end but the argument description does. Add "." everywhere. Also capitalize and add "." for parameter of capabilities. Change-Id: I2355e0d0c38170d669c8e568361faf4b68203d16
* | Fix running the unittests under py3Chmouel Boudjnah2014-05-093-3/+5
|/ | | | | | | Since we added the tests.functional the py3 tests wasn't running properly fixing it with some voodoo testr magic. Change-Id: Id301adb32ba739f05591c4c352e0cf7d87576755
* Merge "Only encode metadata for user customed headers"Jenkins2014-05-082-8/+22
|\
| * Only encode metadata for user customed headersChmouel Boudjnah2014-05-072-8/+22
| | | | | | | | | | | | | | | | | | | | Don't encode standard headers keys but just the x-*-meta- ones. That fixes py3 to not have them casted as bytes and not properly passed to the requests kwargs. Other trivial py3 fixes along the way. Change-Id: I91b95f32fb2aec9b20892a5bb95fd1bc65d002f3
* | Make the function tests Python3-import friendlyAlex Gaynor2014-05-071-6/+7
|/ | | | Change-Id: Ic73fc2a6f6712505eda71fa2e2e91ac680ced9a3
* Merge "Add functional tests for python-swiftclient"Jenkins2014-05-0613-2/+320
|\
| * Add functional tests for python-swiftclientChristian Schwede2014-05-0513-2/+320
| | | | | | | | | | | | | | | | | | 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
* | Merge "Mock auth_end_time in test_shell.test_download"Jenkins2014-04-291-10/+14
|\ \ | |/ |/|
| * Mock auth_end_time in test_shell.test_downloadChmouel Boudjnah2014-04-251-10/+14
| | | | | | | | | | | | | | | | If we don't we are getting an error like this under py3: TypeError: unsupported operand type(s) for /: 'float' and 'MagicMock' Change-Id: If5a6947757297354e6b81fc45f011cc2921d609f
* | Removed a duplicate word in a dostringAlex Gaynor2014-04-251-1/+1
|/ | | | Change-Id: I38e41a7ce9f91b5b1785491c6cd10dbbba9562a2
* Don't utf8 encode urls.Chmouel Boudjnah2014-04-241-2/+2
| | | | | | | | This is not needed since already done by requests. (and it was buggy with py3). Change-Id: I9505c56be2f53eb8071aea3d5fb9d8caa9508e34
* Merge "Fixed several shell tests on Python3."Jenkins2014-04-241-0/+5
|\
| * Fixed several shell tests on Python3.Alex Gaynor2014-04-231-0/+5
| | | | | | | | | | | | | | They currently fail because on Python3 arbitrary objects cannot be compared, in this case, MagicMock and int. In Python2 these comparisons silently pass. Change-Id: I468c2137702a454365886099e827d329cb1d7209
* | Merge "Fix up StringIO use in tests for py3"Jenkins2014-04-241-4/+3
|\ \
| * | Fix up StringIO use in tests for py3Samuel Merritt2014-04-231-4/+3
| |/ | | | | | | | | | | | | | | | | 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