The positional arg is called api_version so when a
client uses the api_version kwarg it gets a python
error. Renaming the positional and using it instead
of the kwarg restores compatability.
Change-Id: Ifca602bdca71814bbbcb2c498efbed374d7c304d
Change [1] introduced support of microversions to manilaclient and
changed behaviour of client init that is not compatible with old
approach. Also, not all old modules have deprecated modules in place.
So, first problem description:
- Old client expected string with api version, new one expects
APIVersion class instance. So, add support for both and cover them with
unit tests.
Second problem description:
- Manila UI project imports "manilaclient.v1.contrib.list_extensions"
directly, but this file was moved to another place without keeping in
place deprecated variant. So, add such to fix backward compatibility
and allow to use newest manilaclient with manila-ui project.
[1] I3733fe85424e39566addc070d42609e508259f19
Change-Id: I838631fb38b8ddf1f4f1e06269af122bf51a5155
Closes-Bug: #1518245
The Manila client needs the following changes to support microversions:
* Maintain backwards compatibility with Kilo. When the client detects
that the server doesn't support microversions it will fall back to
using the v1 API.
* The --os-share-api-version option supports overriding the version.
* If 1.0 is specified as the version the client will load the v1
client and use the server's v1 API.
* The client will send a request for the server's API version and
determine if the client's supported versions and the server's
supported versions overlap. If not the client will display an error
and quit. See diagram 1 below.
* The client supports the @wraps annotation. The annotation is used
with the v2/shell.py commands and any class that inherits from
the Manager class in manilaclient/base.py.
* If an appropriate command version isn't found for commands using
@wraps then the client will display an error and quit.
following commit: ab49d645befd04c84272f0d24e1b604012d191dd.
Diagram 1:
Client:
2.5 2.8
|-------------|
Server1:
2.0 2.5
|-------------|
Client uses version 2.5
Server2:
2.7 2.10
|-------------|
Client uses version 2.8
Server3:
2.9 2.12
|-------------|
Client displays error and quits
Server4:
1.0 (Kilo Server)
|-|
Client detects pre-microversion server and loads v1 client
Example usage of wraps annotation:
* Support 2.0 - 2.4: @api_versions.wraps("2.0", "2.4")
* Support 2.5 - latest: @api_versions.wraps("2.5")
Implements: blueprint manila-client-advanced-microversion-support
Change-Id: I3733fe85424e39566addc070d42609e508259f19
The Manila client's API version is now '2.5' so that it matches the
Manila server's API version.
The client also supports the Manila V2 Keystone endpoint such that it
will only communicate with the Manila V2 API.
Closes-bug: 1494360
Change-Id: I3d011046bbe4f9223d93341f3d3ac09074f52990
Manila client needs to provide 'X-Openstack-Manila-Api-Version' in the
HTTP request header along with the appropriate version. Manila client
also needs to provide 'X-OpenStack-Manila-API-Experimental' in the HTTP
request header for APIs that are marked as experimental. This is a
temporary fix until Manila client can support Nova style microversions.
Closes-bug: #1489450
Change-Id: I6344dfa6d272f0e813a4873c015be614ebeb4e7e
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: Ib86c36f81f6fdbee64d88dd0b1d126bcc16649ac
Currently python-manilaclient doesn't support keystone sessions
unlike to others clients. keystoneclient.session.Session gives
end-user possibility to share common authentication and request
parameters between a variety of services.
- Add python-keystoneclient to requirements.txt
- Move authentication logic to v1/client.py
- Move HttpClient to separate module
- Simplify SecretsHelper in shell.py
- Replace service_catalog module by keystoneclient.service_catalog
- Add appropriate unit tests
Implements bp add-keystone-session-support
Change-Id: I7d1c50fa31d9e2f32bb518a78a02bc12b114d0ab
Instead of try/except blocks, just use the six module which is already
in use in other places.
Also remove a Python 2.5 compat construct. Python 2.5 is no longer supported.
Change-Id: Idb13d861b0f8c567d1e44ce5bf6c60da12a24d18
Replace usage of oslo-incubator modules strutils, importutils, timeutils
with corresponding oslo.utils modules instead.
Removes timeutils module, others will be replaced with next oslo-incubator sync.
Change-Id: I12530f4e4d745f9a95b339182e31189e32e56fa6
jsonutils from oslo-incubator is deprecated, replace it with
oslo.serialization.
Change-Id: I34af54bcb55eb0e1be3b74ea266b5da8bc5dc47d
Closes-Bug: #1383165
First part of manilaclient.utils module cleanup,
where usage of deleted functions replaced with functions
from common code.
Partially implements: blueprint use-common-code
Change-Id: Iefe7da601cdaf030787c6d7588dd0c1706e309cd
apiclient package from common code has 'exceptions' module,
so, lets reuse its exceptions and leave defined only one
exception that is absent there - NoTokenLookupException.
Partially implements: blueprint use-common-code
Change-Id: I024a90c407e2bd8f25f58935ab8a4241e038f3a8
Add option --os-cache, which defaults to OS_CACHE variable
(by default - False). When this option is specified, manilaclient
will use auth token saved in keyring. First time when command will
be called, auth token and user password will be saved in keyring.
Using --os-reset-cache option password and auth_token stored in the
keyring can be deleted.
Implements bp cache-auth-token
Change-Id: Ia8959655528acce726baa616e66901c7a96fd35c
We should use common code where possible.
This change is intended to remove direct usage of json
module and start use jsonutils from manilaclient.openstack.common
Also added lost dependency 'iso8601', that is used by jsonutils
Partially implements: blueprint use-common-code
Change-Id: I42ea803d761b2510c959dc1578a20ff155670283