| Commit message (Collapse) | Author | Age | Files | Lines |
| |\ |
|
| | |
| |
| |
| |
| |
| | |
This path is not currently unit tested.
Change-Id: If38c6352f5e1f0a50e4a0d29fbdd5263ccba3b29
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When we run "cinder help" we can see that there is a --collect-timing
option:
--collect-timing Collect per-API call timing information.
This is a keystone session option that we are not currently acting on
from a user perspective.
This patch adds support for this option, and we'll be able to see the
timing in a similar way as we do with OSC:
$ cinder --collect-timing api-version
+------+---------+---------+-------------+
| ID | Status | Version | Min_version |
+------+---------+---------+-------------+
| v3.0 | CURRENT | 3.66 | 3.0 |
+------+---------+---------+-------------+
+--------+------------------------------------------------+----------+
| method | url | seconds |
+--------+------------------------------------------------+----------+
| GET | http://192.168.121.243/identity | 0.003591 |
| POST | http://192.168.121.243/identity/v3/auth/tokens | 0.016649 |
| GET | http://192.168.121.243/volume/ | 0.004012 |
| GET | http://192.168.121.243/volume/ | 0.004543 |
+--------+------------------------------------------------+----------+
The patch formats the "elapsed" time attribute into seconds and renames
the column to "seconds" to make it more user friendly similar to OSC.
If we didn't it would look like 0:00:00.003744
Closes-Bug: #1960337
Change-Id: Ia6b31794bf60a351007cc4476a76b9bcb76bf378
|
| |\ \ \ |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The json lib has been included in CPython for
ages, so the ImportError case never happens.
Change-Id: I669bc397323a0e83d4a9768b124a7d99bafaf38a
|
| |\ \ \ \
| |/ / /
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Move more code to shell_utils that is only used
for shell operations.
The benefit of this is that the cinderclient library
becomes lighter-weight, because users of the lib
no longer have to import prettytable and extra code.
Change-Id: I7bf6bd91ee5746d1ad4bd4504f3a056d03ae86a9
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In Python3.11, global flags must be placed right at the start of a
regular expression.
The following regex:
r'.*?(?m)^Lists all volumes.',
must become:
r'(?m).*?^Lists all volumes.',
However, since we are using re.MULTILINE, we actually do not need to use
a global flag.
This commit fixes the following tests in Python3.11:
- cinderclient.tests.unit.test_shell.ShellTest.test_help_arg_no_subcommand
- cinderclient.tests.unit.test_shell.ShellTest.test_help
- cinderclient.tests.unit.test_shell.ShellTest.test_help_on_subcommand
- cinderclient.tests.unit.test_shell.ShellTest.test_help_on_subcommand_mv
Closes-Bug: #1983047
Change-Id: If20abef109ddd7107c83b5886beb666a6550a640
|
| |\ \ \ \
| |_|_|/
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In Python3.11, the following code crashes:
$ cat test.py
import argparse
parser = argparse.ArgumentParser(description='Short sample app')
subparsers = parser.add_subparsers()
subparsers.add_parser('foo')
subparsers.add_parser('foo')
$ python3.11 test.py
Traceback (most recent call last):
File "/tmp/arg.py", line 6, in <module>
subparsers.add_parser('foo')
File "/usr/lib/python3.11/argparse.py", line 1197, in add_parser
raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument {foo}: conflicting subparser: foo
It is now forbidden to use add_parser() multiple times with the same
arguments, which is exactly what we do in the following tests:
- cinderclient.tests.unit.test_shell.TestLoadVersionedActions.test_load_versioned_actions
- cinderclient.tests.unit.test_shell.TestLoadVersionedActions.test_load_actions_with_versioned_args
In order to fix the tests failures, we make sure to reset the parser and
subparsers before calling add_parser().
While not strictly necessary, we split those tests into two functions,
for readability purposes.
Closes-Bug: #1983054
Change-Id: I2d4cb81a394f3c10e5f01945d894746a904fb5df
|
| | |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\ \ \ |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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 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
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |\ \ \ \
| |/ / /
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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>
|
| |\ \ \ \ |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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>
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| |\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |\ \ \ \
| |/ / /
|/| | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove code still adjusting for Python 2
behavior based on version checks.
Change-Id: I29576a824278611d80991dce2501f14f1b262c76
|
| |\ \ \ \
| |_|/ /
|/| | | |
|
| | | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\ \ \
| | |/
| |/| |
|
| | |/
| |
| |
| |
| |
| | |
Replace six with Python 3 style code.
Change-Id: I4b97e040f3e790ac114dcd43c68e6b67b1079adf
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Microversion 3.61 adds cluster_name attribute to volume details output
for admin users.
Change-Id: I13f85c8ddd4cb238a245c263151123fd271a9927
Depends-On: https://review.opendev.org/742991
|
| |\ \ \
| |_|/
|/| | |
|