summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | cinderclient might not return version for V2 APIj-griffith2017-07-262-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The get_server_version call in cidnerclient/client.py relies on either finding v 3.x or encountering an exception to revert back to v 2.0. It's not clear that this call will always raise if a non V3 capable Cinder is called, so just to be safe make sure we return a 2.0 response if there's no V3 reported back. Change-Id: I3b5fb895cad4b85d5f4ea286fb33f7dd0929e691 Closes-Bug: #1694729
* | | Merge "Handle AttributeError in _get_server_version_range"Jenkins2017-07-261-0/+9
|\ \ \
| * | | Handle AttributeError in _get_server_version_rangeMatt Riedemann2017-05-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _get_server_version_range only supports a v3 client object because ServiceManager.server_api_version() is only implemented for the v3 client code. If you're trying to call this with a v1 or v2 client object, it will raise an AttributeError which is unhelpful for the end python API client. This change handles the AttributeError and returns a more useful error with an explanation of how the client code is wrong. We could alternatively set versions = None and let it return two empty APIVersion objects, but that seems confusing. This change opts to be explicit about the failure. Change-Id: I2266999df6332b8c5fb0ec808db69bcc847effb0 Closes-Bug: #1694739
* | | | Merge "Support volume summary command"Jenkins2017-07-263-0/+21
|\ \ \ \
| * | | | Support volume summary commandwangxiyuan2017-07-123-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch added volume summary command support. Change-Id: I7cf6e149b9ce9cae21818c60146e6db9cc2904bd
* | | | | Add cinder create --pollChaynika Saikia2017-07-243-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: It adds an optional argument --poll to the cinder create command which waits while the creation of the volume is completed and the volume goes to available state. In case there is an error in volume creation, it throws an error message and exits with a non zero status. The error message printed here is the async error message in case it generates one. Depends-On: Ic3ab32b95abd29e995bc071adc11b1e481b32516 Change-Id: I1a4d361d48a44a0daa830491f415be64f2e356e3
* | | | | Fix highest version supported by client and serverGorka Eguileor2017-07-191-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code mistakenly thinks that 3.40 is older than 3.27, because it's treating 3.40 as 3.4, thus returning the wrong maximum supported version by both server and client. It is also returning a 3.40 version as 3.4 because it's returning it as a float. This patch fixes both issues by not using float conversion but using the APIVersion object to do the comparison and by changing returned type to a string so it can be used to instantiate a client. Change-Id: Ica4d718b3de31c31da047f07c5154b242e122596 Closes-Bug: #1705093
* | | | | Fix reset state v3 unit tests failuresGorka Eguileor2017-07-191-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the order of execution our unit tests could fail because we are caching the reset methods in the RESET_STATE_RESOURCES dictionary in cinderclient.v3.shell and mocking the methods before importing this file will leave future tests with the mocked value. This patch fixes this by mocking find_resource instead of individual find methods, and in one of the tests with a method that will call original method whenever it's not the call we actually wanted to mock. Change-Id: Ic3ab32b95abd29e995bc071adc11b1e481b32516 Closes-Bug: #1705249
* | | | | Merge "Cinder attachment-* does not support names"Jenkins2017-07-181-1/+23
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Cinder attachment-* does not support namesnidhimittalhada2017-07-131-1/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added capability to recognize volume name too in command. It can work with both name and id now. Change-Id: If0fc63042d76beb354e6961e1f2d2936021c3d8e Closes-Bug: #1661043
* | | | Remove consistencygroup quotawangxiyuan2017-07-172-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder doesn't support to update consistencygroup quota. And since cg will be deprecated in Queue, there is no value to support it at server or client side. So this patch removed it. Change-Id: I5fbfb30611a60d575fedb676119bb0a1564700df Closes-bug: #1693584
* | | | Merge "Add pagination for snapshots, backups"Jenkins2017-07-122-1/+32
|\ \ \ \ | |/ / / |/| | |
| * | | Add pagination for snapshots, backupsGerhard Muntingh2017-06-222-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow cinderclient to retrieve more than osapi_max_limit (default 1000) snapshots, backups, etc. Cinder pagination support has been added to the API quite some time ago. Client support was only implemented for volumes. This commit allows other resources to be paginated as well. Change-Id: I9a6f446b680dadedccd14ba49efdef7f5ef0a58a Closes-Bug: #1691229 Co-Authored-By: Gorka Eguileor <geguileo@redhat.com>
* | | | Dynamic log level supportGorka Eguileor2017-07-103-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for microversion 3.32 allowing setting and querying Cinder services' log levels. Two new commands are available: cinder service-get-log [--binary {,*,cinder-api,cinder-volume,cinder-scheduler, cinder-backup}] [--server SERVER] [--prefix PREFIX] cinder service-set-log [--binary {,*,cinder-api,cinder-volume,cinder-scheduler, cinder-backup}] [--server SERVER] [--prefix PREFIX] <log-level> Implements: blueprint dynamic-log-levels Depends-On: Ia5ef81135044733f1dd3970a116f97457b0371de Change-Id: I50b5ea93464b15751e45afa0a05475651eeb53a8
* | | | Tiramisu: replication group supportxing-yang2017-05-053-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds CLI support for replication group. It is built upon the generic volume groups. Server side patch is here: https://review.openstack.org/#/c/352228/ Depends-On: I4d488252bd670b3ebabbcc9f5e29e0e4e913765a Change-Id: I462c3ab8c9c3a6a1b434748f81d208359ffd2431 Implements: blueprint replication-cg
* | | | Support revert to snapshot in clientTommyLike2017-05-043-0/+39
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This patch added revert to snapshot support in cinder client, also fix two pylint errors. Change-Id: I20d8df8d7bcf763f6651f44901a98f6d853b27ce Partial-Implements: blueprint revert-volume-to-snapshot Depends-On: cca9e1ac54d123da8859ff918b2355606bfa474e
* | | Unicode value support for "--filters"Eric Harney2017-06-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | These need to support Unicode values, like our API does. Otherwise the shell client does not work for non-ascii names, etc. Closes-Bug: #1695927 Change-Id: Ib661bb6f8df62084bdf80e7666de5708d13674b7
* | | Merge "Enabled like filter support in client"Jenkins2017-06-211-0/+28
|\ \ \
| * | | Enabled like filter support in clientTommyLike2017-06-211-0/+28
| | |/ | |/| | | | | | | | | | | | | | | | | | | Updated the help message to advertise we support filter resource by inexact match since 3.34. Depends-On: 93b1c1134931749f77c5b3c7bb0f92936b3124e4 Change-Id: I8ea0eb3f0c693c6a2adce33e4d74b2327f124d40
* | | Fix cmd options for updating a quota classjeremy.zhang2017-06-203-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actions on updating volume quota class: [1] Add cmd option 'backups, backup-gigabytes, per-volume-gigabytes' [2] Add test cases for cmd quota-class-show and quota-class-update [3] Fix according test cases Now, cmd option '--consistencygroups' is not yet supported for updating quota class. Change-Id: I482ae501f15a103b9e07f4f17d182c853035dca9
* | | Merge "Support list-volume for group show"Jenkins2017-06-143-2/+30
|\ \ \
| * | | Support list-volume for group showwangxiyuan2017-05-253-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | V3.25 support query groups with volumes, this patch add the client support. Partial-Implements: blueprint improvement-to-query-consistency-group-detail Partial-Bug: #1663474 Change-Id: Ic0d86b9265f295877eebca97ff450f5efd73b184