summaryrefslogtreecommitdiff
path: root/cinderclient/v2/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove v2 support from the shellBrian Rosmaita2021-07-121-2475/+0
| | | | | | | | | | | | Also removes the v2 support from the generic client and restores a skipped test. Additionally, the cinderclient.tests.v2.test_availablity_zone module depends on the v2.shell class, so move that module to v3, update the v3 AvailablityZone class, and make appropriate adjustments to the tests and test fixtures. Change-Id: I7a3cca15f5944141d510a75af6684221c297963b
* Remove all usage of six libraryhaixin2021-03-041-4/+2
| | | | | | Replace six with Python 3 style code. Change-Id: I4b97e040f3e790ac114dcd43c68e6b67b1079adf
* Stop to use the __future__ module.Hervé Beraud2020-06-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: Id785793c36b3a6819a7522525252c3fef15ebe2b
* Drop support for --sort_key and --sort_dirSean McGinnis2019-09-111-18/+2
| | | | | | | | | These arguments were deprecated in the kilo release in favor of a combined --sort argument. This drops support for the deprecated arguments. Change-Id: If8f8ac44cc81f553009a15ca67257e86cb925b6f Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Drop support for --allow-multiattachSean McGinnis2019-09-111-8/+1
| | | | | | | | | | The ability to enable multiattach on the command line was deprecated in Queens with the full implementation of multiattach enabling it through volume type extra specs. This removes the command line arg and handling for specifying it with volume creation. Change-Id: Ifc0c874657f959266050cd1a7a40e6ecccc8c114 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Merge "Drop 'endpoints' and 'credentials' commands"Zuul2019-09-081-19/+0
|\
| * Drop 'endpoints' and 'credentials' commandsSean McGinnis2019-04-181-19/+0
| | | | | | | | | | | | | | | | We are past the deprecation period for these commands and they should now be removed. Change-Id: I37f0dc539da5d43f629ea726bb603fa995c1fe6f Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | Remove promote/reenable replicationMinmin Ren2019-06-191-19/+0
|/ | | | | | | | | | The replication 1.0 API os-promote-replica and os-reenable-replica were removed[1], then remove useless code from cinderclient. [1]: https://review.openstack.org/#/c/275797/ Change-Id: Icf98f294c089942e11607786e932abc959f77b3b
* Fix incorrect punctuationyenai2019-01-281-3/+3
| | | | Change-Id: I70e1ad2d0152e74ab0672a3ac2e7b47f85ee92d7
* Merge "[Optimize] Update help text for hint argument"Zuul2018-10-011-1/+3
|\
| * [Optimize] Update help text for hint argumentTommyLike2018-07-171-1/+3
| | | | | | | | | | | | | | Update scheduler_hint's help text to describe how to specify multiple hints and array value. Change-Id: If975e06b6e9914848498fa2c3ab27c2f41d7860b
* | Merge "Reflect multiattach deprecation in help text"4.0.0Zuul2018-07-271-1/+1
|\ \
| * | Reflect multiattach deprecation in help textSean McGinnis2018-07-261-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Change Icbb9c0ca89b25620cedff6cac7a4723e7126eca6 notified that the ``multiattach`` argument was deprecated, but nothing was added to the args help text to indicate this, relying on a user to have read the release notes. In preparation of removing this option, this updates the help text so there is at least some indication that it is going away. Change-Id: I9e767a3f1411fbfc0bf0e433b45560e451d547d5 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | Remove replication v1 supportSean McGinnis2018-07-261-6/+1
|/ | | | | | | | | | | | The replication v1 implementation in Cinder was deprecated in the Mitaka release in favor of the v2 "Cheesecake" version. Support was kept in the client for backwards compatibility, but it has now been several releases and these options should be removed. Closes-bug: #1705470 Change-Id: I978a39a552fffc9ac7ba6e4726d1df2072fa45ba Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Correct errors in snapshot-manageable-list help textSean McGinnis2018-03-201-10/+11
| | | | | | | | Fixes some copy paste issues with the help text for listing snapshots. Also minor grammar fixes. Closes-bug: #1756358 Change-Id: Idee5e8400d8e7d55e9f9232df55b0dfec3e36c3b
* Update help text for encryption providerBrianna Poulos2018-02-161-3/+3
| | | | | | | | | The volume encryption provider no longer uses class names. Instead, 'luks' and 'plain' are used. This patch updates the help text for the volume encryption provider to use the new encryption provider format constants. Change-Id: I6072e18f8c1945082f421a3bf725a874565d6f80
* Removes unicode 'u' response for "cinder get-capabilities"Abijitha Nadagouda2018-01-231-1/+2
| | | | | | | | | | | | | | | | | 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
* Support create volume from backup in clientTommyLike2017-12-071-2/+3
| | | | | | | | | This patch adds create volume from backup support in cinderclient. Change-Id: I01dbcf6b113d88732c174b848be2127ee7242b3c Implements: blueprint support-create-volume-from-backup Depends-On: 58d0fb327f9fc980e0c8b84dcd9f64c093285d13
* Fix attachment_id returned by create and show volumeSteve Noyes2017-08-281-1/+1
| | | | | | | | | | | | | 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
* Merge "cinder show with attachments is a mess"Jenkins2017-07-261-1/+15
|\
| * cinder show with attachments is a messJohn Griffith2017-07-031-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Remove consistencygroup quotawangxiyuan2017-07-171-4/+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
* | Fix output of update commandpoojajadhav2017-07-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | User have no information at all, regarding the update of APIs (Consistency Group, Snapshot and Backup). This patch fixes output issue and displays user friendly message based on operation of update command. Closes-Bug: #1664894 Change-Id: I58f0a3729990e9f90f01b7d84e65a13af799fd97
* | Fix cmd options for updating a quota classjeremy.zhang2017-06-201-0/+12
|/ | | | | | | | | | | | 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 "Cleared type restrictions for metadata option"Jenkins2017-05-251-5/+0
|\
| * Cleared type restrictions for metadata optionAlexey Stupnikov2017-05-241-5/+0
| | | | | | | | | | | | | | | | | | | | It turns out that it is impossible to send unicode metadata values with some cinder commands. The reason is a type restriction that demands all values to be a 'str' type. As a result, it is impossible to use unicode. Change-Id: I1213b0d3b8177b670cd3e5d587fee9dabd971923 Closes-bug: #1693151
* | Merge "Handle dashes in encryption-type-create arguments"Jenkins2017-05-241-9/+16
|\ \ | |/ |/|
| * Handle dashes in encryption-type-create argumentsEric Harney2017-05-241-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encryption-type-create currently takes args "--key_size" and "--control_location". Our standard is to use dashes rather than underscores for arguments like this, because it's easier to type them. Additionally, encryption-type-update already uses "--key-size" and "--control-location" for the same args. This adds the dashed versions to the CLI and makes them the default shown in the help. The underscore versions are retained for compatibility. Also removes redundant "(Optional)" text for arguments listed under "Optional Arguments". This matches other commands. Change-Id: I1bd2b7657ec577b9775eacd163cfdf6eb6b6eab2
* | Remove duplicate do_upload_to_image() method deflihaijing2017-03-201-41/+0
|/ | | | | | | | In cinderclient/v2/shell.py line348 and line1107, you can find the same method defination: def do_upload_to_image(). It doesn't make sense. So remove one of them. Change-Id: I0b5f2bd0c935d75d873720c9bd38f8cefe31bb30
* Merge "Remove cinder credentials command"Jenkins2017-03-101-7/+3
|\
| * Remove cinder credentials commandJon Bernard2017-02-231-7/+3
| | | | | | | | | | | | | | | | This function has been broken for some time, this patch replaces it with a helpful message. This function can be removed in the next release. Change-Id: Ic0a4177e7818c0a1493c15d9e496dc14c63ae7a3 Close-Bug: #1615695
* | Group show command should be in V3wangxiyuan2017-02-201-13/+0
|/ | | | | | | | | Group feature was introduced in Cinder V3, So the command should be there as well. But the "group show" command is in V2 which is wrong. Change-Id: If3ba44b2b188607542bdadfeb58f8e4b363837b7 Closes-bug: #1663496
* Remove duplicate columns from list outputDinesh Bhor2017-02-141-1/+6
| | | | | | | | | | | | | | | | | | If you specify duplicate fields in --fields, then it prints duplicate columns on the console. By default 'ID' column is added to the output so if you specified it in --fields, then it shouldn't be displayed twice. A user can pass 'NaMe', ' Name ' or 'naMe' in --fields option and it displays same name values three times under the user supplied column names. If a user doesn't pass --fields option, then it shows "Name" column in the list. To maintain consistency between user supplied column and default column names, converted it into title case and removed leading and trailing whitespaces. Kept ID field as capital only('ID') for consistency. Closes-Bug: #1659742 Change-Id: I98999e4c5934b56cd2e5a3fac1fe4d2a73a0d5a1
* Add --metadata option to API v2 cinder list command againMitsuhiro Tanino2017-02-031-4/+3
| | | | | | | | | | | | | | | | | | | | | | | In the commit I90a2b713556e91db69270a03ef6b798e08f93f90, --metadata option of do_list() in v2/shell.py was unexpectedly removed and --image_metadata option was added instead of --metadata option. This is wrong fix because --image_metadata option requires API version >= "3.4" and is not supported at API v2. On the other hands, --metadata option of do_list() is supported from API v1. We should remove --image_metadata option and then add --metadata option to do_list() again. Also comment on API v3 cinder list --metadata should be fixed because this doesn't require API >=3.4. Co-Authored-By: Masaki Kimura <masaki.kimura.kz@hitachi.com> Change-Id: Ic7d5cfa2acb47fbf73776e034d958ad8fb9119a8 Closes-Bug: #1661045
* Removed unnecessary 'service_type' decoratorIvan Kolodyazhny2017-01-231-106/+0
| | | | | | | | | | | | | | | @utils.service_type was introduced with 'Initial split from python-novaclient' commit and used for CLI. Now both Python and Command-line APIs for each version work well without this decorator. Unused 'get_service_type' function is removed too. 'utils.retype_method' removed as well because everything works well without it. Change-Id: Ic2470d8ca9d581b7c47da8d7e6a414c3c78ad27a Partial-Bug: #1643584 Related-Bug: #1621126
* Fix spelling of consistency groupsPetr Kovar2017-01-181-2/+2
| | | | | | Trivial fixes making the consistency group spelling more consistent. Change-Id: I3716606a5415f2cbf966749de17b512c347b1790
* Refactor v2 and v3 APIs supportIvan Kolodyazhny2016-12-201-40/+2515
| | | | | | | | | | | Now v2 API uses code from v3. It's confusing and logically incorrect. This patch makes v3 API as an extended version of v2. The next patches related to this bug duplicated code between v1 and v2, v2 and v3 will be removed. Change-Id: I90a2b713556e91db69270a03ef6b798e08f93f90 Partial-Bug: #1643584
* List manageable volumes and snapshotsAvishay Traeger2016-07-191-0/+86
| | | | | | | | | | | | | Cinder currently has the ability to take over the management of existing volumes and snapshots ("manage existing") and to relinquish management of volumes and snapshots ("unmanage"). The API to manage an existing volume takes a reference, which is a driver-specific string that is used to identify the volume on the storage backend. This patch adds the client code for APIs for listing volumes and snapshots available for management to make this flow more user-friendly. Change-Id: Icd81a77294d9190ac6dbaa7e7d35e4dedf45e49f Implements: blueprint list-manage-existing
* Enhance help message of upload_to_imageCao Shufeng2016-08-251-1/+2
| | | | | | | | | | | | | Following the commit fb2c434c2461a25193067104de766fc1142a6024 in the cinder repo the --force option to upload-to-image is ignored by default. To enable it the config option enable_force_upload must be set to true. The help text for upload-to-image in the python cinderclient should remind user that --force may not work in some cloud now. Closes-Bug: #1611667 Change-Id: Ib56fb2016d933a9bbbcb0185c50e33d2166b34e6
* Fix upload_to_image method1.7.1Ivan Kolodyazhny2016-05-201-0/+43
| | | | | | | | | | | Commit Ie639179c5bbbaca4de62b42b368830afcfd8f7ac introduced 'visibility' and 'protected' params. These params should be used only with v3.1 microversion. Also these changes break current v2 users. This patch fixes these issues. Closes-Bug: #1584056 Change-Id: I0574631791c475bbefdb6e7d1647a20d0759df64
* Add /v3 endpoint support for cinderclientscottda2016-04-181-2592/+4
| | | | | | | | | | | | Add support for Cinder API /v3 endpoint. A couple of unit tests for /v3 endpoint were added to v3/test_shell.py to ensure that the v3 shell works, and to also test that modules work with: from cinderclient.v2.availability_zones import * syntax. Change-Id: I6ae0ada221bebb4ab1850d9c99b10fcbb585201f Implements: https://blueprints.launchpad.net/python-cinderclient/+spec/add-v3-endpoint-support
* Merge "Fix api v2 so that you can delete more than one volume_type at a time."Jenkins2016-03-311-5/+17
|\
| * Fix api v2 so that you can delete more than one volume_type at a time.zwei2016-03-291-5/+17
| | | | | | | | | | | | | | | | | | This path is also allowing us to delete them by name or ID instead of only by ID. eg: cinder --os-volume-api-version 2 type-delete test01 test02 Closes-bug: #1554794 Change-Id: I54faad2c5b60ab69f4b406310eb8059cf1e8cf76
* | Merge "Removed Extra code"Jenkins2016-03-241-1/+0
|\ \
| * | Removed Extra coderoot2016-03-141-1/+0
| |/ | | | | | | | | | | | | | | Some extra code is present like unused variables, unreachable code after return statement etc. Same is removed. Change-Id: Ifca88a19625c56ed520321ecbdd91739a304be8e
* | Add docstrings for chessecake methodsJohn Griffith2016-03-081-0/+3
|/ | | | | | | | | We missed docstrings on freeze, thaw and failover replication v2.1 methods. This adds them. Change-Id: If68a674c66b4f18e80432d1cef269b02813fcc37
* Merge "Add --cascade to volume delete"Jenkins2016-03-021-1/+7
|\
| * Add --cascade to volume deleteEric Harney2016-02-241-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the --cascade parameter to the volume delete command. Using this will call the volume delete with an additional parameter that deletes snapshots as part of the same operation. The name "cascade" is chosen to be somewhat generic, so that we can extend this if desired in the future. (And to hint at the terminology from SQL.) Depends-On: I33d15b76d4bd0de14c635d404b2c97096c977a58 Change-Id: I05ce61e647c43f9a1e6d74444356a76e5d284673 Blueprint: del-vols-with-snaps
* | Remove replication v2 calls1.6.0Alex O'Rourke2016-03-011-54/+0
| | | | | | | | | | | | | | | | | | | | With replication v2.1 merged in cinder and the calls merged in the client, there is no longer a need for the old calls. If these commands are called with the newest cinder code, it fails miserably. Basically reverts this patch: https://review.openstack.org/#/c/231708 Change-Id: I29c0565c1efe518e40c3483ceb4ca0d40cd7d0d7
* | Merge "Add replication v2.1 (cheesecake) calls"Jenkins2016-02-291-0/+31
|\ \