summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge "Replace assertRaisesRegexp with assertRaisesRegex"Zuul2018-11-102-10/+10
|\
| * Replace assertRaisesRegexp with assertRaisesRegexzhangyangyang2018-08-292-10/+10
| | | | | | | | | | | | | | This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex(). Change-Id: I85025ad141f8436913ba192716435ce63e1e2d05
* | Merge "Fix encoding of query parameters"4.1.0Zuul2018-10-034-35/+38
|\ \
| * | Fix encoding of query parametersGoutham Pacha Ravi2018-09-134-35/+38
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IETF RFC 3986 classifies "~" as a reserved character [1], however until python3.7 [2], python's url parsing used to encode this character. urllib has seen a lot of churn in various python releases, and hence we were using a six wrapper to shield ourselves, however, this backwards-incompatible change in encoding norms forces us to deal with the problem at our end. Cinder's API accepts "~" in both, its encoded or un-encoded forms. So, let's stop encoding it within cinderclient, regardless of the version of python running it. Also fix an inconsitency around the use of the generic helper method in utils added in I3a3ae90cc6011d1aa0cc39db4329d9bc08801904 (cinderclient/utils.py - build_query_param) to allow for False as a value in the query. [1] https://tools.ietf.org/html/rfc3986.html [2] https://docs.python.org/3/library/urllib.parse.html#url-quoting Change-Id: I89809694ac3e4081ce83fd4f788f9355d6772f59 Closes-Bug: #1784728
* | Merge "Fix backwards compat for volume transfer < 3.55"Zuul2018-10-022-27/+65
|\ \
| * | Fix backwards compat for volume transfer < 3.55Sean McGinnis2018-08-042-27/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All volume transfer v3 calls were being sent to the endpoint introduced with microversion 3.55. This fixes backwards compatibility by routing calls less than 3.55 to the original API extension endpoint. Change-Id: I7205033ddd5be126b8614372a9fc82a2bc555f48 Closes-bug: #1785330 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Merge "Fix endpoint identification for api-version query"Zuul2018-10-021-3/+14
|\ \ \ | |_|/ |/| |
| * | Fix endpoint identification for api-version querySean McGinnis2018-08-061-3/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | The api-version query is a GET against the root endpoint of cinder. Determining this root endpoint had a flaw with the newer wsgi deployment URLs that would cause it to find the root endpoint of the web server and not cinder. This updates the logic to work with legacy, wsgi, and custom URLs for the Cinder endpoint. Change-Id: Iaeba1f8d50ee8cc9410cc9f638770a56796871fb Closes-bug: #1785594 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | __repr__ crashes when empty dict passedwhoami-rajat2018-08-131-0/+5
|/ | | | | | | | | | The Capabilities class __repr__ method crashes when along with any manager object, the info is passed as empty dict. This patch handles the issue. Change-Id: Ife5cfc82137d107b27b011aa83c3a9c89e78d701 Closes-Bug: #1785091
* Allow volume-transfer creation < 3.55 microversion4.0.1Sean McGinnis2018-07-312-10/+21
| | | | | | | | | | | Handling for the new `no_snapshots` option was incorrectly handling microversion evaluation that would prevent anything less than the new microversion from working. This changes the check to only handle the changed argument for 3.55 and later. Change-Id: If96889ccde6044706e6a5dcd83fde3c20fe1c1fd Closes-bug: #1784703 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Remove unnecessary parameters from volume create APIsNeha Alhat2018-07-264-56/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As per Cinder code, following parameters are not required to be passed in the request body of create volume API. * status * user_id * attach_status * project_id * source_replica If you pass these parameters, previously it was ignored but in the schema validation changes[1] we don't allow additionalProperties to be passed in the request body. If user passes additional parameters which are not as per API specs[2], then it will be rejected with 400 error. On patch[3], tempest tests: test_volume_snapshot_create_get_list_delete, test_volume_create_get_delete" are failing because of these unnecessary parameters. This patch removes these unnecessary parameters passed to the create Volume API. [1]https://blueprints.launchpad.net/cinder/+spec/json-schema-validation [2]https://review.openstack.org/#/c/507386/ [3]https://review.openstack.org/#/c/573093/ Change-Id: I37744bfd0b0bc59682c3e680c1200f608ad3991b
* Merge "Transfer snapshots with volumes"Zuul2018-07-203-0/+115
|\
| * Transfer snapshots with volumeswanghao2018-07-193-0/+115
| | | | | | | | | | | | | | | | | | This patch will support to transfer volumes with or without snapshots in new V3 api after mircoversion 3.55. Change-Id: I61a84b5abf386a4073baea57d8820c8fd762ae03 Depends-On: https://review.openstack.org/533564/ Implements: blueprint transfer-snps-with-vols
* | Add mode option to attachment-createJohn Griffith2018-07-172-1/+45
|/ | | | | | | | | | | | We introduce a mode option in attachment-create starting with microversion 3.54. The mode option is the new/preferred way of setting ro mode (as opposed to admin-metadata). This patch adds the support for the mode option to the client for endpoints that support 3.54. Depends-on: https://review.openstack.org/532702/ Change-Id: I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
* Keep is_public usage backwards compatible3.6.1Sean McGinnis2018-06-222-7/+22
| | | | | | | | | | | 5a1513244caf7acbd41e181419bc8b62bf4bcaba added the ability to filter by AZ, but it changed the existing behavior if is_public was not specified. This adds handling to make sure we are still consistent with the previous behavior. Co-Authored-by: Alan Bishop <abishop@redhat.com> Change-Id: I5000aab092c1b434c8dc17bbe4b2d3d632f528c3 Closes-bug: #1778055
* unable to create group from src in cinderclientwanghao2018-06-202-7/+8
| | | | | | | | | | | According the api schema of cinder, create_group_from_src should only specify one of arguments from [group_snapshot_id, source_group_id]. Now cinderclient specified them both even if one of them is None. This patch fix this issue to just pass one argument. Change-Id: Idef51ab9a1452dd5eb3be4d4b6dca095a777d611 Closes-Bug: #1777555
* Merge "Add the parameter service-id for service cleanup command"Zuul2018-05-281-2/+4
|\
| * Add the parameter service-id for service cleanup commandliuyamin2018-05-251-2/+4
| | | | | | | | | | | | | | | | There isn't service_id param in cinderclient. We have this param in cinder, so add this param in the cinderclient. Change-Id: I579741595f91802bcf117029889567f234b5b14c Closes-bug: #1771721
* | Remove useless args in create_group_from_srcwanghao2018-05-222-9/+0
| | | | | | | | | | | | | | | | | | | | | | Remove status, project_id and user_id args from create_group_from_src. Those args will cause error when using cinderclient since schema validation in Cinder side. Change-Id: Iba9a45625f9e6423e8e582425605ca184238cde9 Closes-Bug: #1772375
* | Merge "Support availability-zone in volume type"Zuul2018-05-201-0/+14
|\ \ | |/ |/|
| * Support availability-zone in volume typeTommyLike2018-05-021-0/+14
| | | | | | | | | | | | | | | | | | | | Since 3.52, new option '--filters' has been added to 'type-list' command, and it's only valid for administrator. Change-Id: I140f6d61a2747d4fcaabfbccea864dcc7eb841d1 Depends-On: I4e6aa7af707bd063e7edf2b0bf28e3071ad5c67a Partial-Implements: bp support-az-in-volumetype
* | Allow --help for specific commandsEric Harney2018-04-101-0/+11
|/ | | | | | | | | | | | This makes calls such as: $ cinder list --help work as expected, equivalent to: $ cinder help list rather than just printing the full help message. Change-Id: I038eeeea554f0bb5dd170f503eaec570441520b3
* Support cross AZ backupsGorka Eguileor2018-02-121-0/+13
| | | | | | | | | | | Add support for microversion 3.51 that allows us to specify the Availability Zone of the backup service that should create the backup. New optional parameter available for "backup-create" when using microversion 3.51 is "--availability-zone". Depends-On: I595932276088d25abd464025c99dce33a2cc502b Change-Id: Ia4bab5fcb95f6a8d1adb99c5d7dc1b3f7546c6f6
* Fix for v3 volume unit testsjeremy.zhang2018-01-256-33/+47
| | | | | | | This patch is mainly to specify the APIversion for FakeClient used in different volume resources' unit tests. Change-Id: I18eb9b57434061e95c909907e6ba263b9091a446
* Removes unicode 'u' response for "cinder get-capabilities"Abijitha Nadagouda2018-01-231-3/+3
| | | | | | | | | | | | | | | | | The output of "cinder get-capabilities" command returns unicoded response. But it would appear from the utils class that setting formatters will go through the capabilities dict and make sure all values are properly string formatted. Therefore added formatters to return string formatted response. Added formatters=sorted(prop.keys()) line instead of static values as suggested by the reviewer, to avoid tying server knowledge to the client and also any update on the server side would easily reflect here. Closes-bug: #1680444 Change-Id: Ie38236db364d59ddab42cb925d0435777b0ffe86
* Merge "Support for reporting backend state in service list"Zuul2018-01-182-0/+21
|\
| * Support for reporting backend state in service listwanghao2018-01-092-0/+21
| | | | | | | | | | | | | | | | | | | | This patch will support the feature: report backend state in service list in client side. Depends-On: I561dca3ef7c1901401621bc112389dbd178a907e Change-Id: If15e1fa50b5feecd74c7394c918f4fc9d87bcf3e Implements: blueprint report-backend-state-in-service-list
* | Merge "Migrate to keystoneauth identity cli opts."Zuul2018-01-171-0/+16
|\ \
| * | Migrate to keystoneauth identity cli opts.Zhao Chao2018-01-161-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use keystoneauth1 to parse keystone authentication arguments. Previously these arguments are parsed in the different service clients seperately. Use keystoneauth1 instead will make this consistent across projects and less error-prone. This change is inspired by NovaClient. Co-Authored-By: Morgan Fainberg <morgan.fainberg@gmail.com> Co-Authored-By: David Hu <david.hu@hp.com> Co-Authored-By: Monty Taylor <mordred@inaugust.com> Closes-Bug: #1734945 Change-Id: I3c5141eeddd3747ff542e95b04e4848470ad9508 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* | Merge "Fix v2 volume unit tests"Zuul2018-01-161-17/+15
|\ \
| * | Fix v2 volume unit testsjeremy.zhang2018-01-081-17/+15
| |/ | | | | | | | | | | | | This patch is mainly to fix the wrongly used fake client in v2 volume unit tests. Change-Id: If0d0aa7a95b7d58886cc77e8a377ac2f17985f18
* | Merge "Add service cleanup command"Zuul2018-01-162-0/+31
|\ \
| * | Add service cleanup commandGorka Eguileor2017-10-032-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder volume services will perform cleanup on start, but when we have multiple volume services grouped in a cluster, we may want to trigger cleanup of services that are down. This patch adds command `work-cleanup` to trigger server cleanups and prints service nodes that will be cleaned and those that didn't have an alternative service in the cluster to do the cleanup. This command will only work on servers supporting API version 3.24 or higher. New command: cinder work-cleanup [--cluster <cluster-name>] [--host <hostname>] [--binary <binary>] [--is-up <True|true|False|false>] [--disabled <True|true|False|false>] [--resource-id <resource-id>] [--resource-type <Volume|Snapshot>] Specs: https://specs.openstack.org/openstack/cinder-specs/specs/newton/ha-aa-cleanup.html Change-Id: I1c33ffbffcb14f34ee2bda9042e706937b1147d7 Depends-On: If336b6569b171846954ed6eb73f5a4314c6c7e2e Implements: blueprint cinder-volume-active-active-support
* | | Merge "Add cluster support in manage listings"Zuul2018-01-161-0/+35
|\ \ \ | |/ /
| * | Add cluster support in manage listingsGorka Eguileor2017-10-031-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for API microversion 3.17, which allows us to pass --cluster optional argument to volume and snapshot manage listings. Implements: blueprint cinder-volume-active-active-support Change-Id: I97b5f2e9960d5a1f140fc638804dbc631d63ff9d
* | | Fix 'cluster' paramter using for v3 volume managejeremy.zhang2018-01-052-1/+11
| |/ |/| | | | | | | | | | | The 'cluster' paramter is wrongly provided for v3 volume manage, as it should be included in the 'volume' object. Change-Id: I12440aa6ada9c0e058138e8da7f7bc12359847bb
* | Merge "Fix the way to get backup metadata"Zuul2017-12-201-2/+13
|\ \
| * | Fix the way to get backup metadatalihaijing2017-12-131-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In v3/shell.py do_backup_update(), the metadata through 'args.metadata' is a list, like this: 'metadata': [u'k1=v1']. But we need a metadata dict like this: 'metadata': {"k1": "v1"}. So call the right method shell_utils.extract_metadata() to get metadata from args. Change-Id: I82cb96b1f89b4009d4b3f4a0e64db076a7a04977
* | | Merge "Backup create is not available from 3.0 to 3.42"Zuul2017-12-151-6/+24
|\ \ \
| * | | Backup create is not available from 3.0 to 3.42TommyLike2017-12-141-6/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | Backup create command is shielded by patch [1]. [1]: 2255fc99da9752737dcaa96ae4507b646074afb2 Change-Id: I100b8734ee2df4d81e16e2bfdafd81227c20d25e
* | | Removed unnecessary parameters from group and group_snapshots create APIspooja jadhav2017-12-143-17/+5
|/ / | | | | | | | | | | | | | | | | | | | | As per code, the 'status', 'user_id' and 'project_id' parameter is not required to be passed in the request body in case of group and group_snapshot create APIs. Even if you pass these parameter, it is silently ignored in the code. This patch removes those parameters passed in the request body. Change-Id: I29e7d4c8a3eee52f4ea7278d2edf2c7deec40628
* | Support create volume from backup in clientTommyLike2017-12-072-2/+33
| | | | | | | | | | | | | | | | | | This patch adds create volume from backup support in cinderclient. Change-Id: I01dbcf6b113d88732c174b848be2127ee7242b3c Implements: blueprint support-create-volume-from-backup Depends-On: 58d0fb327f9fc980e0c8b84dcd9f64c093285d13
* | Support list with 'with_count' in clientTommyLike2017-12-052-2/+29
| | | | | | | | | | | | | | | | Add 'with_count' parameter in list volume, snapshot and backup APIs. Change-Id: I2b7b41b3579c24703a7a67ab5dc6f960a3ccbdc2 Partial-Implements: bp add-amount-info-in-list-api
* | Merge "Add cluster support in migration and manage"Zuul2017-12-014-15/+184
|\ \ | |/
| * Add cluster support in migration and manageGorka Eguileor2017-10-034-15/+184
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for API microversion 3.16, which allows us to pass --cluster optional argument to migration and manage operations. For this, a new type of CLI argument is added, the mutually exclusive arguments that can be used similarly to the utils.arg decorator, but with utils.exclusive_arg decorator. Implements: blueprint cinder-volume-active-active-support Change-Id: If004715b9887d2a0f9fc630b44d6e11a4a8b778d
* | Merge "Remove unused attribute when updating quota_class"Zuul2017-11-022-5/+2
|\ \
| * | Remove unused attribute when updating quota_classTommyLike2017-08-182-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating quota class, attribute 'class_name' is neither used in the request nor the response [1]. [1]: https://github.com/openstack/cinder/blob/master/cinder/api/contrib/quota_classes.py#L56 Change-Id: Ic1a743ce36a087f369703f10313d51b79b5cab9c
* | | Merge "Fix OS_AUTH_TYPE env var usage"Zuul2017-10-191-0/+20
|\ \ \
| * | | Fix OS_AUTH_TYPE env var usageGorka Eguileor2017-08-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now only deprecated OS_AUTH_SYSTEM environmental variable works to set the authentication to noauth, the reason is that we have multiple arguments writing on the same destination. This patch fixes this by making both arguments have the same default value, which is to use environmental variable OS_AUTH_TYPE if it has a value or deprecated OS_AUTH_SYSTEM if not. Closes-Bug: #1708687 Change-Id: I478fb0e628d4bebd4a1dc78c2559202916aa051f
* | | | Merge "Add api_version_wraps to attachment-complete"Jenkins2017-10-083-6/+91
|\ \ \ \ | |_|_|/ |/| | |