| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
Remove code still adjusting for Python 2
behavior based on version checks.
Change-Id: I29576a824278611d80991dce2501f14f1b262c76
|
| |
|
|
|
|
| |
Replace six with Python 3 style code.
Change-Id: I4b97e040f3e790ac114dcd43c68e6b67b1079adf
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
The --bypass-url argument was removed with
I3b951cc4eb3adff23f3d2cbe674971816261ef56 so this name does not make
sense now. Replace with os_endpoint.
Change-Id: Ifa889cc2e885e9c621c8494995b2020195b696ca
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This tests that the expected subcommands register
in the shell client, by looking at the output
that would show up in "cinder help".
The purpose of this is to help prevent us from
accidentally deleting some commands when refactoring
shell code.
TODO: cover commands post-3.0
Change-Id: Ifcbc08ae9184fa33049b18f8ad7ef5d92003a7b8
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch does the following :
1) Errors out if similar type of filters args are passed
Eg :
cinder list --name abc --name xyz
cinder list --name abc --filters name=xyz
2) Allows multiple filter parameters of different type
cinder list --filters name=abc --filters size=1
Change-Id: I2f8662555f830b0821147324849d04e7a29d0580
|
| |/
|
|
|
|
|
|
| |
These have been deprecated for a very long time now. Switch to only
support the current OS_PROJECT_NAME and OS_PROJECT_ID.
Change-Id: I2fb78768b4308a3aaf12764edadb58d4a307adaa
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If OS_VOLUME_API_VERSION is not set, use the highest
supported by both the client and the server.
If OS_VOLUME_API_VERSION exceeds that supported by the server,
use the highest supported by both the client and the server.
A warning message is printed for the user indicating that this
happened.
(This is similar to the behavior of the manila CLI, and is
mostly code from manilaclient tweaked to work in cinderclient.)
Change-Id: Ie1403eca2a191f62169e60c0cde1622575327387
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit fefe331f218d73ba6d1d7acf81b5eb02609c953e incorrectly set the
default API version to the max the client knew about in order to get the
full help output, including all microversioned commands.
The original intent was to have help print out information for all
versions, but still require the user to specify a version if they wanted
to use any microversioned version of an API. The code accidentally made
it so all commands would request the max version the client knew about.
This meant an unspecified request would get the newer functionality
rather than the default v3 functionality, and also meant the client
could request a microversion higher than what the server knew about,
resulting in an unexpected error being returned.
To keep the originally intended functionality, but keep all help output,
this only uses the max API version for the help command unless the user
specifies otherwise.
Closes-bug: #1813967
Change-Id: I20f6c5471ffefe5524a4d48c967e2e8db53233f1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
Per [1], don't.
[1] http://lists.openstack.org/pipermail/openstack-dev/2018-November/136289.html
Change-Id: I4a1e8cf84a88e5bd301d1baba41b064cde336f38
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are inconsistent with some other projects with hiding client help
output for commands added with microversions by default. This often
leads to confusion with users of the CLI not being aware of these
changes.
This changes the default to display all help output. Users can still
specify a version and have the output limited to include only options up
to the version they specify.
Change-Id: I39d90a1ecc824fcf445e98609de47d45e71a0ff6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The following options were deprecated in Queens or Pike and are now
being removed:
--endpoint-type
--bypass-url
--os-auth-system
Change-Id: I3b951cc4eb3adff23f3d2cbe674971816261ef56
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Change-Id: Icb6c9808829c6088f6ae2408718bcb03ddc7b53a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
| |
Enforce ordering of imports with H306.
For tests, this is mostly done by grouping test
imports after other cinderclient imports.
Change-Id: Ie40fda014d1aedb057e5b4ea1f27f999c84e6373
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
In the file cinderclient/shell.py, packages requests and six
are double imported. This patch is to clean the redundant code.
Change-Id: I4bade57753a50245df1b4b82c4a8708d3b0acdba
|
| |/
|
|
|
|
|
|
| |
--profile argument can be loaded from OS_PROFILE environment variables
to avoid repeating --profile in client commands.
Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: Ia9b469024395327ec0ee082ddaea3234fc3ca5a6
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This fixes some wording and formatting issues with the help
text that is printed for CLI arguments.
The duplication of default values for os-auth-system appears
to lead to attribute errors requiring explicitly unsetting
OS_AUTH_TYPE.
Closes-bug: #1695054
Change-Id: I0263ef2fb15744f7e352c7365e7d9e61c1ebc974
|
| |\ |
|
| | |
| |
| |
| | |
Change-Id: I8c6cfbefc45cd1e54ce9d15280c93b02114faf94
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch includes several improvements:
1. Use keystoneauth1 plugin mechanism for auth plugins.
2. Implements CinderNoAuthPlugin.
3. Deletes non-working cinderclient.auth_plugin module.
4. Deprecates --bypass-url in flavor of --os-endpoint to be consistent
with keystoneauth1 plugins.
5. Deprecates in --os-auth-system in falvor of --os-auth-type to be
consistent with keystoneauth1 plugins.
Both bypass_url and os_auth_system params are not changed for client
objects to not break backward compatibility for Python API.
How to use noauth with cinderclient CLI:
OS_USER_ID=userid OS_PROJECT_ID=projectis cinder --os-auth-type noauth
--os-endpoint=http://localhost:8776/v2 list
Change-Id: I3be59a5a39235acbc3334e0a0b797081507a5c88
Closes-Bug: #1657156
|
| |
|
|
|
|
|
|
|
| |
There are some PEP8 errors that are not caught by our gate because of
the pep8 package version installed by hacking.
This patch fixes E402, W503, and F999 erors from our codebase.
Change-Id: I0b86730b1493f161645a87c3daa91ec3d774d3b1
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds in a version-list command that reports the
min/max versions of the Cinder API supported by this
version of the client, and also queries the Cinder API
V3 server to obtain min/max micro-versions and report
those as well.
In addition, we bump the default version of the client to
3.0, of course if you specify V2 in your rc file or on the
cmd line that works fine too.
I did run into one problem where I broke:
cinder.tests.unit.test_shell:test_cinder_service_name
Seems to be some hidden trickery with a fake, fixture or
mock that I can't figure out. For now I added a skip to
that test, but maybe somebody can point out the problem
during review.
Change-Id: I44e667c511d89de28af758a3c9ea1f812e682f18
|
| |/
|
|
|
|
|
|
|
|
| |
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.
[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages
Change-Id: Ib5f86d1f0846e292457813c893b73c6999e554a5
Closes-Bug: #1596829
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify some codes in order to lead them meet the python3 common pattern.
Look through the following patterns of Cinder,
map() and filter() if a list is needed on Python 3:
Replace map(func, data) with [func(item) for item in data]
Replace filter(lambda obj: test(obj), data) with
[obj for obj in data if test(obj)]
Replace exceptions.OSError with OSError and
remove "import exceptions"
Replace iterator.next() with next(iterator)
Replace basestring with six.string_types
Replace unicode with six.text_type
Replace (str, unicode) with six.string_types
Replace "for key in dict.iterkeys()" with "for key in dict"
Replace dict.iteritems() with dict.items()
Replace dict.itervalues() with dict.values()
I found that only "filter(lambda obj: test(obj), data)" and
"map(func, data)"need to modify.
The other items are not be founded in Cinder.
Reference:https://wiki.openstack.org/wiki/Python3#Common_patterns
Change-Id: If33ec39eb176c14086132d3099c6ec577f956ded
|
| |
|
|
|
|
|
|
|
| |
If there is an exception raised by cinder-api while using
--profile option, the trace ID is not printed. Moving the
trace ID print statement to finally block to fix this.
Change-Id: I03df8cd47185d148051d66396f6cd8118efff73c
Closes-bug: #1642888
|
| |
|
|
|
|
|
|
|
|
|
| |
Currently the dest of the deprecated --endpoint-type arg
is 'endpoint_type'. However, the code only uses 'os_endpoint_type'
so right now it isn't being used at all. This patch updates
the dest to be 'os_endpoint_type' so that the variable can
be assigned correctly.
Change-Id: Ie8592d12bcf95e4ccff571e831440b18f5acfd40
Closes-bug: #1454436
|
| |
|
|
|
|
|
|
| |
Help msg and output info should support il8n.
And delete the unused import six.
Close-Bug: #1629157
Change-Id: Ie1faf0a83ec5f04dc6c8303f1ea0c931ba482e2a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the cinder shell is run in debug mode
(CINDERCLIENT_DEBUG is set in the environment or
with --debug), print a traceback for unhandled
exceptions.
This makes it possible to debug issues like this:
$ cinder credentials
ERROR: list indices must be integers, not str
Related-Bug: #1631142
Co-Authored-By: Gorka Eguileor <geguileo@redhat.com>
Change-Id: I5e9b3283602d404ab43494f15d57ec5abbcd77dc
|
| |
|
|
|
|
|
|
|
| |
In shell.py, six is imported twice.
In this patchset, one of them is removed.
TrivialFix
Change-Id: Ifbf6dcb20d5de54855aab53538b57eb11185ab2b
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).
While this works it is not very pythonic, since you have to write
expressions such as:
if not min_version and not max_version:
return True
elif ((min_version and max_version) and
max_version.is_null() and min_version.is_null()):
return True
This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.
So previous code would just look like:
if not min_version and not max_version:
return True
Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.
Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now, "cinder help subcommand" can not show whether an argument
is supported for a specific microversion.
With this change, developers only need to add a start_version or
end_version in the utils.arg wrap, cinderclient will support
the microversion for that arguement.
@utils.arg(
'--foo',
start_version='3.1')
@utils.arg(
'--bar',
start_version='3.2',
end_version='3.5')
def do_some_action():
......
In previous example, an exception will be raised for such command:
$ cinder --os-volume-api-version 3.6 --bar some-ation
And only "--foo" will show up for such help command:
$ cinder --os-volume-api-version 3.1 help some-ation
Change-Id: I74137486992846bbf9fdff53c009851db2356eef
Partial-Bug: #1600567
Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>
|
| |
|
|
|
|
|
|
|
| |
'six' is an independent third party module so it doesn't
need to be imported and used from oslo_utils.strutils.
TrivialFix
Change-Id: Icb3232bb1ebae0e8332e66c5806474d7f9dfd6df
|