summaryrefslogtreecommitdiff
path: root/cinderclient
Commit message (Collapse)AuthorAgeFilesLines
* Handle downgraded client for snapshot-create9.2.0Brian Rosmaita2022-11-083-0/+92
| | | | | | | | | | | | | | | | | | | When a CLI user specifies --os-volume api-version 3.66, the shell will execute the appropriate shell code, but if the server only supports < 3.66, the client is automatically downgraded and correctly uses the pre-3.66 SnapshotManager.create() method. In that case, the 'force' parameter, which is technically not allowed in mv 3.66 (but which silently accepts a True value for backward compatibility), will have a value of None, which the pre-3.66 code happily passes to cinder as '"force": null' in the request body, and which then fails the Block Storage API request-schema check. Handle this situation by detecting a None 'force' value and setting it to its pre-3.66 default value of False. Change-Id: I3ad8283c2a9aaac58c8d2b50fa7ac86b617e5dd3 Closes-bug: #1995883
* Bump API max version to 3.709.1.0Alan Bishop2022-08-091-1/+1
| | | | | | | | | | Bump MAX_VERSION to 3.70 to support the following: - 3.69 - Allow null value for shared_targets - 3.70 - Support encrypted volume transfers Implements: bp/transfer-encrypted-volume Depends-On: I459f06504e90025c9c0b539981d3d56a2a9394c7 Change-Id: I11072d6d8a185037c7f4cdd52c45933b0cccaf05
* Fix extension loading from python pathzack chen2022-06-291-0/+2
| | | | | | | | | Commit 3502a5591a654ae57741c6738994ffa9d8457696 broke extension loading from pythonpath. Incompatible on python3.6.8, python3.8, python3.9. Put it back. Closes-Bug: #1980184 Change-Id: I5b67c93e3c789252d9bd35ee69dddbe1b556dec4
* Add volume reimage commandwhoami-rajat2022-02-247-1/+74
| | | | | | | | | | A new reimage API will be introduced on cinder API side with change in depends on. This patch provides the CLI support for the same by adding a reimage command. Implements: blueprint add-volume-re-image-api Change-Id: I37c254d4caf2f416e456ff6a78b5a4df4e08a176
* Improve help text of volume create commandwhoami-rajat2021-11-082-2/+11
| | | | | | | | | This patch adds information about whichever default type is set for API will be used during volume creation if we don't provide a volume type in volume create command. This patch also improves the help text of `cinder type-default` command. Change-Id: I0c437b2c4f02c12d17c04719cbeff8521647ae15
* Support Block Storage API mv 3.66Brian Rosmaita2021-09-025-57/+245
| | | | | | | | | | | | | | Block Storage API mv 3.66 enables snapshots of in-use volumes without requiring a 'force' flag. For backward compatibility, the API silently accepts force=true, even though the 'force' flag is considered invalid for that call. That behavior is replicated in the client, where --force with a true value is silently accepted. The --force option is not advertised in the shell and an option value that doesn't evaluate to true raises an UnsupportedAttribute error. Similar behavior from the v3 Snapshot class, except it raises a ValueError under similar circumstances. Change-Id: I7408d0e3a5ed7f4cbcaf65cf3434ad60aaed511d
* Merge "Fix list resources when use limit and with-count"Zuul2021-08-301-0/+6
|\
| * Fix list resources when use limit and with-countzhu.boxiang2020-12-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When we use with-count query param, we will get the count of resources. While the _list function return two different result, one is just list, another is tuple with list and int. So we must to handle the items which return from _list function. Closes-bug: #1908474 Change-Id: If8e31a637cf098cca60d8a10e9835ef66a3e66bc
* | Merge "client: Stop logging request-id twice in DEBUG"Zuul2021-08-301-14/+0
|\ \
| * | client: Stop logging request-id twice in DEBUGLee Yarwood2021-03-101-14/+0
| | | | | | | | | | | | | | | | | | | | | This is already logged by http_log_resp in DEBUG along with the other response headers so drop the duplicate logging in _log_request_id. Change-Id: I3c5ad2b480d80611ecb10449068d836c4bbe7bdb
* | | Add consumes quota field supportGorka Eguileor2021-08-253-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder microversion v3.65 adds consumes_quota key to volume and snapshots as a way to differentiate between use generated resources and temporary ones. This patch adds support for this microversion and presents the consumes_quota field when the server sends it (which only happens when we request this microversion). Change-Id: I524490aa988fa4d654bfa8050d89cf99ce50bb4b Depends-On: I655a47fc75ddc11caf1defe984d9a66a9ad5a2e7 Implements: blueprint temp-resources
* | | Merge "Make instance_uuid optional in attachment create"8.0.0Zuul2021-07-205-3/+69
|\ \ \
| * | | Make instance_uuid optional in attachment createRajat Dhasmana2021-07-145-3/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder and cinderclient assumes an attachment create request will always contain instance_uuid. This is not true when glance calls cinder for attachment in glance cinder configuration. This patch (along with the cinder patch) make the instance_uuid optional and allow glance to do attachments without passing instance_uuid. Change-Id: Ifbaca4aa87d890bc5130069638d42665b914b378
* | | | Remove v2 classesBrian Rosmaita2021-07-1470-2037/+1115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all cinderclient.v2 classes, mostly incorporating them into their v3 counterparts and updating the tests and test fixtures. Depends-on: https://review.opendev.org/c/openstack/horizon/+/800814 Change-Id: I335db5c1799edb2273bf8bfc9e1bc9de404a4ba5
* | | | Remove v2 support from the shellBrian Rosmaita2021-07-1213-1454/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Support passing client certificates for server version requests"Zuul2021-04-205-15/+49
|\ \ \ \ | |/ / / |/| | |
| * | | Support passing client certificates for server version requestssri harsha mekala2021-03-095-15/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the cinderclient to fetch server versions will fail with error `OpenSSL.SSL.Error: [sslv3 alert handshake failure]` when the server requires client certificates to be passed with these requests. Added the optional parameter `cert` to both get_server_version get_highest_client_server_version and methods so that users can have the option to pass client certificates while fetching server versions. Also support passing mTLS certificate/key to HTTPClient Closes-Bug: #1915996 Change-Id: I57c665dd9d4b8c32e5f10994d891d1e0f5315548 Signed-off-by: sri harsha mekala <smekala@oath.com>
* | | | Merge "Add flake8-import-order extension"Zuul2021-03-1119-50/+38
|\ \ \ \
| * | | | Add flake8-import-order extensionSean McGinnis2021-03-1019-50/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the import order extension to match what we have in the cinder repo. This is a linting extension that will check that imports are in the correct order and the correct grouping so they automatically get flagged, and it won't be whether reviewers notice and decide to do anything or not. Cinder change was Ic13ba238a4a45c6219f4de131cfe0366219d722f for a little more wordy reasoning. Also includes updates for noqa tags. Newer version of the linters appear to want these on the function definition line, not on the decorator line. Change-Id: Ibf3f3afbf3bb6ec6613b35f91d4a353c6a391f41 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | | | Dropping explicit unicode literaltushargite962021-03-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In python 3, all strings are considered as unicode string. This patch drops the explicit unicode literal (u'...') or (u"..") appearances from the unicode strings. Change-Id: I9902966892a1dc4f85d449dfe580fb128647487b
* | | | | Merge "Bump API max version to 3.64"Zuul2021-03-101-1/+1
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Bump API max version to 3.64Alan Bishop2021-03-091-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump MAX_VERSION to 3.64 to support including the encryption_key_id attribute in volume and backup details. Implements: blueprint include-encryption-key-id-in-details Depends-On: I16f54e6722cdbcbad4af1eb0d30264b0039412fd Change-Id: I6e1f3ff62d4b7b9b8299f7bd73071c3c7856f6df
* | | | Merge "Remove more python2 compat code"Zuul2021-03-102-15/+2
|\ \ \ \ | |/ / / |/| | |
| * | | Remove more python2 compat codeEric Harney2021-03-082-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove code still adjusting for Python 2 behavior based on version checks. Change-Id: I29576a824278611d80991dce2501f14f1b262c76
* | | | Merge "Add MV 3.63 to the max supported version"Zuul2021-03-101-1/+1
|\ \ \ \ | |_|/ / |/| | |
| * | | Add MV 3.63 to the max supported versionRafael Weingärtner2021-01-271-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the implementation on [1], it was requested to extend the Cinder client to support the newly created microversion (MV). Therefore, this patch is doing exactly that. We do not need to do any other work forward bcause the list volumes will display whatever we have in the response. I mean, the default is ``['ID', 'Status', 'Name', 'Size', 'Volume Type', 'Bootable', 'Attached to']``, but one can customize these fields using ``--fields`` [1] https://review.opendev.org/c/openstack/cinder/+/666886 Closes-Bug: https://bugs.launchpad.net/python-cinderclient/+bug/1913474 Depends-on: https://review.opendev.org/c/openstack/cinder/+/666886 Change-Id: I0815570a50e9b38fe18733c727acd52a406bfc1e
* | | Merge "Remove all usage of six library"Zuul2021-03-0827-157/+80
|\ \ \ | | |/ | |/|
| * | Remove all usage of six libraryhaixin2021-03-0427-157/+80
| |/ | | | | | | | | | | Replace six with Python 3 style code. Change-Id: I4b97e040f3e790ac114dcd43c68e6b67b1079adf
* | Support backup-restore to a specific volume type or AZAlan Bishop2021-01-112-0/+225
|/ | | | | | | | | | | | | Enhance the 'backup-restore' shell command to support restoring a backup to a newly created volume of a specific volume type and/or in a different AZ. New '--volume-type' and '--availability-zone' arguments leverage the existing cinder API's ability to create a volume from a backup, which was added in microversion v3.47. The shell code is a new v3 implementation, and it drops support for the v2 command's deprecated '--volume-id' argument. Change-Id: Ic6645d3b973f8487903c5f57e936ba3b4b3bf005
* Fix undesirable raw Python errorEduardo Santos2020-10-292-0/+15
| | | | | | | | | | | | | | Using the cinderclient without a subcommand while passing an optional argument triggers the raw Python error `ERROR: 'Namespace' object has no attribute 'func'`. This bug can be reproduced by issuing the command `cinder --os-volume-api-version 3.40`. Added a default value to `func` and an empty value to `command` as placeholders so that a help message is shown instead of the Python error. Change-Id: Idb51e8635b97f0da2976f3268d5e19100ec77203 Closes-Bug: #1867061
* Merge "Add commands for default type overrides"Zuul2020-09-169-1/+271
|\
| * Add commands for default type overrideswhoami-rajat2020-09-169-1/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds command for set,get and delete default volume types for projects. This patch adds 3 commands : 1) Set Set a default volume type for a project cinder --os-volume-api-version 3.62 default-type-set <vol-type-id> <project-id> 2) Get Get the default volume type for a project cinder --os-volume-api-version 3.62 default-type-list --project-id <project-id> Get all default types cinder --os-volume-api-version 3.62 default-type-list 3) Unset Unset default volume type for a project cinder --os-volume-api-version 3.62 default-type-unset <project-id> Implements: Blueprint multiple-default-volume-types Change-Id: Id2fb00c218edbb98df3193577dba6a897c6e73f6
* | Merge "Use importlib to take place of imp module"Zuul2020-09-091-2/+11
|\ \ | |/ |/|
| * Use importlib to take place of imp modulezhoulinhui2020-09-021-2/+11
| | | | | | | | | | | | | | | | | | The imp module is deprecated[1] since version 3.4, use importlib to instead [1]: https://docs.python.org/3/library/imp.html Change-Id: Ie250592bc183e8db1758b6cfa4681a45f4c489ab
* | Merge "[goal] Migrate python-cinderclient jobs to focal"Zuul2020-09-047-16/+19
|\ \ | |/ |/|
| * [goal] Migrate python-cinderclient jobs to focalGhanshyam Mann2020-08-177-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per victoria cycle testing runtime and community goal[1] we need to migrate upstream CI/CD to Ubuntu Focal(20.04). Fixing: - bug#1886298 Bump the lower constraints for required deps which added python3.8 support in their later version. - pep8 error - Set bionic nodeset for py36 and py37 job. [1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-fo$ Story: #2007865 Task: #40179 Change-Id: Ibab96807a7747738282732fe0069b9bc197da0ee
* | Merge "Add support for Cinder API mv3.61"Zuul2020-09-021-1/+1
|\ \
| * | Add support for Cinder API mv3.61Ivan Kolodyazhny2020-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Microversion 3.61 adds cluster_name attribute to volume details output for admin users. Change-Id: I13f85c8ddd4cb238a245c263151123fd271a9927 Depends-On: https://review.opendev.org/742991
* | | Merge "Clean up some old v1 API references"Zuul2020-08-211-5/+2
|\ \ \ | |_|/ |/| |
| * | Clean up some old v1 API referencesSean McGinnis2020-06-021-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes some code that was still pointing to the V1 API. No need to add release note or additional announcements since this was all removed long ago, and if anyone would have gone down this code path it would have just blown up trying to import the v1 code that is no longer there. Change-Id: I7d239d3fe3d879e4c391e83cae1e394cf1f5e6eb Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Merge "use stevedore to load util plugins"Zuul2020-08-051-6/+11
|\ \ \
| * | | use stevedore to load util pluginsDoug Hellmann2020-07-051-6/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing pkg_resources has a side-effect of scanning all of the installed python modules looking for entrypoints to build an in-memory cache. Stevedore will be adding an on-disk cache to speed that process up, which should provide significant performance benefits for client applications such as python-openstackclient. This change introduces stevedore to replace pkg_resources. Change-Id: I66decf6d5a4f79ddaa6617737e9334a56dbbbad4 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* | | Merge "Stop to use the __future__ module."Zuul2020-08-057-14/+0
|\ \ \
| * | | Stop to use the __future__ module.Hervé Beraud2020-06-027-14/+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
* | | Bump hacking to 3.1.0Eric Harney2020-07-164-5/+11
| |/ |/| | | | | | | | | | | | | | | | | | | pycodestyle does not know about "importutils.try_import" calls, so we have to either a) put them inside a "try" block or b) add "# noqa: E402" to each import after the try_import call Change-Id: Ia545bb689cfdfb57962d74e3957dfb372fd3782b
* | Merge "Use unittest.mock instead of third party mock"Zuul2020-06-2212-33/+32
|\ \
| * | Use unittest.mock instead of third party mockSean McGinnis2020-06-0512-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: Ia41326a601dfd72750bd81c3ebee9ec5884ad91b Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Fix typo: dow -> downLuigi Toscano2020-06-161-1/+1
|/ / | | | | | | | | Closes-Bug: #1883674 Change-Id: I4f4468b23d04ecf74fb6347bfb518377127b563d
* | Add directive to document CLISean McGinnis2020-06-032-3/+3
|/ | | | | | | | | | | | | | | | Our CLI docs are very out of date. These used to be generated by the docs team with some tooling they had. Since the docs moved in-repo, that tooling has gone away, and for the most part no one has done any updates to the CLI docs. This adds a sphinx directive that will generate these docs every time the docs are built. This way, whenever someone makes a CLI change, they do not need to have to know to also edit a documentation file to match their change. Any code changes will automatically be picked up and reflected in the docs. Change-Id: I4406872ab6e9335e338b710e492171580df74fa5 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Merge "Replace bypass_url with os_endpoint"Zuul2020-04-076-20/+21
|\