summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\ \ \ \ | |_|_|/ |/| | |
| * | | Add api_version_wraps to attachment-completej-griffith2017-09-093-6/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attachment-complete method didn't include the version checking. This patch adds that and adds a couple of tests. Change-Id: I63dba6ee6d56bb63a79f3ad2ef3412ebd9c1ce07 Closes-Bug: #1715732
* | | | Implement UserID in snapshot list responsej-griffith2017-09-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a gap in the microversions implemented in the cinderclient and the MAX version being reported by the client. One of those is the addition of "user_id" in the snapshot list response. This patch adds that with the appropriate version checking. Note that the Max version has already been updated, but there are a few implementations missing. Change-Id: Ia8bdb46b46091a89996e404825466430b8906d18 Partial-Bug: #1715759
* | | | Implement metadata for backup create/updatej-griffith2017-09-091-0/+8
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a gap in the micro versions implemented in the cinderclient and the MAX version being reported by the client. This patch addresses the missing changes for micro version 3.43 which adds support for metadata for backup create and update. Change-Id: I14c7205784c53ec3ab0985a4460a88f59de171fb Partial-Bug: #1715759
* | | Merge "Fix attachment_id returned by create and show volume"Jenkins2017-08-282-2/+20
|\ \ \
| * | | Fix attachment_id returned by create and show volumeSteve Noyes2017-08-282-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attachment_ids in the volume info returned by show volume were incorrect. It was showing the volume_id, not the actual attachment_id. This fix changes the attachment_ids returned by show volume to correctly reflect the attachment_id. Also, added a unit test for this, and added an attachment_id to the fake volume so that other tests wouldn't now fail. Closes-Bug: #1713082 Change-Id: I9ec36af5dd460d03d786aeeb3cc36a869c19ff62
* | | | Enable F811, F821Eric Harney2017-08-232-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | F811 is a little noisy with api_versions.wraps() decorated methods, but opting to disable it in these cases seems better than missing problems in the rest of the code. Change-Id: I9c46938ab2a442e55f96b5ab6c119c4475afaecd
* | | Fix method/module redefinition errorsEric Harney2017-08-233-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are caught by F811, but that test is currently disabled because it fails on @api_versions.wraps() decorated methods. Just clean up these errors for now. Change-Id: I42aed024352f798ebafddeb6f12880d8726360fe
* | | Merge "Enable H306"Jenkins2017-08-2227-32/+53
|\ \ \ | |_|/ |/| |
| * | Enable H306Eric Harney2017-08-0127-32/+53
| |/ | | | | | | | | | | | | | | | | Enforce ordering of imports with H306. For tests, this is mostly done by grouping test imports after other cinderclient imports. Change-Id: Ie40fda014d1aedb057e5b4ea1f27f999c84e6373
* | Merge "Support skip-validation for quota update"Jenkins2017-08-081-0/+29
|\ \
| * | Support skip-validation for quota updatewangxiyuan2017-07-181-0/+29
| | | | | | | | | | | | | | | | | | Support skip-validation parameter for quota update. Change-Id: Iec4f1598987c632f45ad6eee751f78bedbf3ec26
* | | Fix get_highest_client_server_version with Cinder API + uWSGIIvan Kolodyazhny2017-08-041-10/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | get_highest_client_server_version should work with any endpoint type: cinder-api with eventlet, uWSGI, etc. This patch is based on python-novaclient patch [1]. In a future, we can deprecate get_highest_client_server_version in flavor of keystoneauth descovery feature. [1] Icba858b496855e2ffd71b35168e8057b28236119 Closes-Bug: #1708188 Change-Id: I9acf6dc84c32b25bfe3254eb0f97248736498d32
* | Merge "cinder show with attachments is a mess"Jenkins2017-07-261-1/+2
|\ \
| * | cinder show with attachments is a messJohn Griffith2017-07-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The show command currently just dumps the entire attachments dictionary into the output which is a real mess and completely screws up the displayed output (shell command). There's really no reason to do this, we can just give the attachment ID's and then when you're on the newer versions you can do an attachment-show for all the crazy details if you want. Keep in mind that the list command already shows the server-id we're attached too, but that might also be nice from the show command rather than jumping through multiple commands. To try and accomodate various use cases we'll also add an "attached_servers" field to the show command, but you'll have to coorelate manually from there. Change-Id: I45ac49d8d9a185c52727c5bc24a6a1323be83689 Closes-Bug: #1494941