This drops compatibility with Cinder services with the V1 API.
Change-Id: Ic7c6bd05a3991c3afce3dec80b29501932c5aac9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Our checking for keystone v2 and v3 was causing v2 tests to go down the
v1 code path. Fixing this surfaced a couple of long standing issues with
our v2/v3 handling of redirects and getting auth info.
This fixes our version identification, fixes extracting redirect
location for response headers, and returning the auth_url to calling
code.
Change-Id: I939ff027bf43e513e338bff1e99ca41fa52637b6
Closes-bug: #1825372
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Functionality was added during stein, but the MAX_VERSION of the client
was not updated for these versions. This raises the version to support
the added functionality.
3.57 - Improve volume transfer records - no client changes
3.58 - Add project_id to group - no client changes
3.59 is not included here as that adds sort and pagination that will
need to be slightly reworked before we expose it.
Change-Id: If8a3b88b9a2811ae6681e52dbca62b906d3542eb
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Backup user_id was added with microversion 3.56 but never added to the
client. Added in Rocky with I3ffb544ef3ee65276cee8b1e870d524fd0e57085.
Change-Id: Ib9a4159db0f8af599dcf8315334de4f859be077e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Functionality was added during rocky, but the MAX_VERSION of the client
was not updated for these versions. This raises the version to support
the added functionality.
3.53 - Schema validation - no client changes
3.54 - Add mode option to attachment-create:
I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
3.55 - Transfer snapshots with volumes
I61a84b5abf386a4073baea57d8820c8fd762ae03
Change-Id: I8c8fb8f552e529c8474a3e3b771ba8eb7aed193a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Upload-to-image would error after launching
the operation if the volume type is None.
Closes-Bug: #1821818
Change-Id: I015e0ddfa98d62f25334e2df5effaee72a3988ab
This should not be here since this is client
library code, but it isn't needed anyhow since
this completion is handled from the shell code.
Closes-Bug: #1817782
Change-Id: I3e7ddbe4a50a66db8961a71d71592ce708320b0d
The all_tenants filter is passed to API when it's value is 0
(when not specified) which shouldn't be the case.
This patch only allows adding of all_tenants when specified
manually by user.
Change-Id: Ic7810c4d6e9f4be7c28c7a8778d57bb5ccb996a0
Closes-Bug: #1808621
Closes-Bug: #1808622
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>
This enables writing ids to a local completion
cache when using the cinderclient shell, which
allows tools/cinder.bash_completion to complete
commands such as
cinder delete a<tab>
Volume ids are recorded on "cinder list" and
"cinder create" operations, similar for backup ids.
This functionality was unintentionally removed in
changes some time ago. Labeled as Partial-Bug
because I haven't added name caching yet, which also
used to exist.
Partial-Bug: #1712835
Change-Id: Id56aa43b061758a00a2a8c9c92a5a33ab9f7ab84
(cherry picked from commit c4b37c2830fdd90b57383a93e09a8bd40ca41221)
FIPS 140-2 does not allow MD5 use for most purposes and systems
in "FIPS mode" (fips=1 kernel flag) will cause software using
MD5 from popular libraries to fail.
Also change the default cache dir to use ~/.cache/
Change-Id: I6f653f10249992196abb04e05c54df5fb244b182
Adding the comment flake8:noqa in a file will skip linting the entire
file. Most of the time, the intent was just to skip individual lines to
handle exception cases.
This gets rid of the "flake8:" prefix where it was used incorrectly and
fixes a few legitimate errors that were being hidden by the entire file
being skipped.
The behavior is change in flake8 to handle this better, which will
result in pep8 job failures if these are not fixes first. See more
information in the 3.6.0 release notes:
http://flake8.pycqa.org/en/latest/release-notes/3.6.0.html#features
Change-Id: I56cb20a7c8885c101826d4fe28c315de02b6ecb8
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>
Specifying size is not required while providing --backup-id.
Also When we don't provide the size the output turns out to be
error: Size is a required parameter if snapshot or source
volume or backup is not specified.
which should be modified in 'size' info too.
Change-Id: Ia250df37db9170757d5f834d516781e04582f08b
IETF RFC 3986 classifies "~" as a reserved character [1],
however until python3.7 [2], python's url parsing
used to encode this character.
urllib has seen a lot of churn in various python
releases, and hence we were using a six wrapper
to shield ourselves, however, this backwards-incompatible
change in encoding norms forces us to deal with
the problem at our end.
Cinder's API accepts "~" in both, its encoded
or un-encoded forms. So, let's stop encoding it
within cinderclient, regardless of the version
of python running it.
Also fix an inconsitency around the use of the
generic helper method in utils added in
I3a3ae90cc6011d1aa0cc39db4329d9bc08801904
(cinderclient/utils.py - build_query_param)
to allow for False as a value in the query.
[1] https://tools.ietf.org/html/rfc3986.html
[2] https://docs.python.org/3/library/urllib.parse.html#url-quoting
Change-Id: I89809694ac3e4081ce83fd4f788f9355d6772f59
Closes-Bug: #1784728
With the api-schema enforcement on the Cinder API side, the error
message returned when specifying a volume creation of 0 has changed.
This results in our functional tests failing.
Change-Id: I1a9a13f683134faa01ad50f7f073db8b1845a901
This replaces the deprecated (in python 3.2) unittest.TestCase method
assertRaisesRegexp() with assertRaisesRegex().
Change-Id: I85025ad141f8436913ba192716435ce63e1e2d05
The Capabilities class __repr__ method crashes when
along with any manager object, the info is passed as
empty dict.
This patch handles the issue.
Change-Id: Ife5cfc82137d107b27b011aa83c3a9c89e78d701
Closes-Bug: #1785091
Refer to a merged commit.
https://review.openstack.org/#/c/588983/
Refactor the getid method both in cinderclient/base.py
and in cinderclient/apiclient/base.py
TrivialFix
Change-Id: I4d1fb81f6876ab072ded3f14004ad064dcc949d3
The api-version query is a GET against the root endpoint of cinder.
Determining this root endpoint had a flaw with the newer wsgi deployment
URLs that would cause it to find the root endpoint of the web server and
not cinder.
This updates the logic to work with legacy, wsgi, and custom URLs for
the Cinder endpoint.
Change-Id: Iaeba1f8d50ee8cc9410cc9f638770a56796871fb
Closes-bug: #1785594
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
All volume transfer v3 calls were being sent to the endpoint introduced
with microversion 3.55. This fixes backwards compatibility by routing
calls less than 3.55 to the original API extension endpoint.
Change-Id: I7205033ddd5be126b8614372a9fc82a2bc555f48
Closes-bug: #1785330
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Handling for the new `no_snapshots` option was incorrectly handling
microversion evaluation that would prevent anything less than the new
microversion from working. This changes the check to only handle the
changed argument for 3.55 and later.
Change-Id: If96889ccde6044706e6a5dcd83fde3c20fe1c1fd
Closes-bug: #1784703
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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>
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>
As per Cinder code, following parameters are not required to be
passed in the request body of create volume API.
* status
* user_id
* attach_status
* project_id
* source_replica
If you pass these parameters, previously it was ignored but in the
schema validation changes[1] we don't allow additionalProperties to be
passed in the request body. If user passes additional parameters which
are not as per API specs[2], then it will be rejected with 400 error.
On patch[3], tempest tests: test_volume_snapshot_create_get_list_delete,
test_volume_create_get_delete" are failing because of these unnecessary
parameters.
This patch removes these unnecessary parameters passed to the create
Volume API.
[1]https://blueprints.launchpad.net/cinder/+spec/json-schema-validation
[2]https://review.openstack.org/#/c/507386/
[3]https://review.openstack.org/#/c/573093/
Change-Id: I37744bfd0b0bc59682c3e680c1200f608ad3991b
The pylint job was switched over to run under python 3, but
the job is not voting and it was apparently missed that the
conversion was causing it to fail.
This updates the version of pylint to one that is actually
supported by python 3 and makes tweaks to our script to
for the minor changes between versions.
Single character change to get rid of the more strict py3
regex string escape character format.
Change-Id: I93124b62c5ee177815457b32f55f5453fc3d387e
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 patch will support to transfer volumes with or without
snapshots in new V3 api after mircoversion 3.55.
Change-Id: I61a84b5abf386a4073baea57d8820c8fd762ae03
Depends-On: https://review.openstack.org/533564/
Implements: blueprint transfer-snps-with-vols