- The BaseException class no longer has a "message"
attribute in python 3 [1]. On the contrary, the
string representation of an Exception object will
print all the exception args in all supported
python versions, so use that instead.
- Functional tests were run with a specific locale,
remove those annotations so we can handle unicode
encoding and decoding in python3 envs.
- Cleanup errors were not being handled correctly,
cleanup the code so we don't have spurious failures.
- In python3, dict.keys() gives you a view for lazy
loading, so convert occurrences to lists as expected
in our functional tests.
- Start capturing STDOUT and STDERR in tox envs to
enable troubleshooting.
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Closes-Bug: #1811627
Closes-Bug: #1811516
Change-Id: Idaa2fb9b60451b3fbd298e19574195f2d663c6f4
[1] https://www.python.org/dev/peps/pep-0352/#transition-plan
Currently, we only allow $manila help subcomand to print
subcomands info, if we are using $manila subcomand --help,
it will print all the subcomands info, that is not what we
want, this change is to allow '--help' to print subcomands
info. finally we can see the following comands are equals:
$ manila --help list
$ manila list --help
$ manila help list
Change-Id: I926defd6c5d3b8d87b038e2c63db694b40a88359
Close-bug: #1771097
This issue occurs when we list share without add manilav1 endpoint,
there will be "could not find Manila endpoint in catalog".
Since manilav1 has been deprecated for a couple of releases, so there
is no need to add manilav1 endpoint when using manila v2 API.
This change is to fix it without add manilav1 endpoint, we can also
perform manila command with manilav2 endpoint when using manila v2
API.
Change-Id: I68b499e153e1aba3a5a285f07d71e31b6af65bca
Closes-Bug: #1558995
Closes-Bug: #1734016
In _discover_client method endpoint_type gets DEFAULT_MANILA_ENDPOINT_TYPE
rather getting endpoint type from shell. In case
DEFAULT_MANILA_ENDPOINT_TYPE unavaliable client fails.
Co-Authored-By: Thomas Bechtold <tbechtold@suse.com>
Closes-Bug: #1620491
Change-Id: I132fa448994b2f42e7fd8873425f81c88dbde8ee
keystoneclient.session has been long deprecated in favor of
keystoneauth1.session. This change corrects the import to use
keystoneauth1.session instead of keystoneclient.session.
Change-Id: Ibb3448fa4f96bbaf899a9ed010556c1c43896e29
The Oslo team has moved all previously incubated code from the
openstack/oslo-incubator repository into separate library repositories
and released those libraries to the Python Package Index. Many of our
big tent project teams are still using the old, unsupported, incubated
versions of the code. The Oslo team has been working to remove that
incubated code from projects, and the time has come to finish that work.
As one of community-wide goals in Ocata, please see:
https://github.com/openstack/governance/blob/master/goals/ocata/remove-incubated-oslo-code.rst
Note: This commit also fix pep8 violations.
Change-Id: I03288adb94c702d1d63df88ef9ba33a2ff59eaa3
Specifying only token or only bypass_url leads to a client error.
Better to have a corresponding sanity check on shell level to
include the needed parameters/env variables.
Change-Id: I55dac599d4dadc273eacab14746bf449d3495f2b
Closes-bug: #1604820
Old env variables are still supported but the default ones should
consistently use OS_ as prefix.
Change-Id: Idd26a587cade7f6a27115c4e8cf220cd43b1703e
Closes-bug: #1603387
Python part of Manilaclient does support auth by token, but
CLI part does not. Therefore, add two new optional args
with related env vars:
--os-token [OS_TOKEN]
--bypass-url [MANILACLIENT_BYPASS_URL]
Also, disable checks for other auth data if these two are provided.
Change-Id: I567294dfb61e702410c3f0fadc15a04667075434
Closes-Bug: #1572095
For the moment if default value for CLI option with
"single_alias" action is different than None we cannot redefine it.
Fix it and cover with unit tests.
Also, fix existing aliases and add some where good to have.
Change-Id: Ic61426d9bd894b01f9b035d6d19bb7bd113f96ad
Closes-Bug: #1552771
If the maximum client version is higher than the maximum server version,
but the server version is otherwise valid, an UnsupportedVersion
exception is thrown. This bug fixes this issue by downgrading the
requested version, during API version discovery, from the maximum
client version to the maximum server version. The maximum server version
must be supported by the client. If all conditions are properly met the
client will continue to use the maximum server version for the remainder
of the request.
In order to log that the client version is being downgraded to match
the server version, when using the --debug flag, it was necessary to
update the logging configuration. Logging can now be used anywhere in
manilaclient as needed.
Change-Id: I96d273071966d2dc63de40c6f1b777fbb34a50fa
Closes-Bug: 1559290
Some env var names (the vars starting with manilaclient_) are mixing
lower and uppercase. To be consistent with the other env vars (and
also with env vars from other openstack client projects), add also
the only-upper-case var names. Newly added env variables are:
- MANILACLIENT_UUID_CACHE_DIR
- MANILACLIENT_DEBUG
- MANILACLIENT_INSECURE
Closes-bug: #1535284
Change-Id: Ifd43c6d226487d2b1c4ec099096595373725e596
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
Keystone is used for authentication in Manila and the latter's
client does not support latest version of it that exists for long time.
So, add support of Keystone v3 API and make Manila client to use it
at first priority if it is available.
Change-Id: I3e2f505f46f7ab60c66bcb0b1d65a38bea602df4
Closes-Bug: #1499260
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
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
When we have more than one alias for one command option, like
"manila list [--snapshot_id %id%][--snapshot-id %id%]"
We should be ok provided request like following:
"manila list --snapshot %id%"
This change makes above possible.
Also added restriction to use only one alias at a time.
Change-Id: Ibd7de3b75408d50ff97b5b9d19307a5612d7b425
Closes-Bug: #1379472
Make help strings consistent, following oslo.config recommendations:
* Capitalize properly
* Fix grammar and language
* Add "." at end of help string
Change-Id: I412eca2ee67c5e6152f0a70b2a5073ebd190796d
Remove functions 'arg', 'env' and 'add_arg' from
manilaclient.utils and use same functions from cliutils instead.
Partially implements: blueprint use-common-code
Change-Id: Ib41250d527c5949cdfb7c6956703ff4b371a062b
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
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
Added detail parameter to list methods for security_services
and share_networks in v1.
Closes-bug #1297824
Change-Id: Iac2384bbf69c18f75291cc58509e8e99d0ac93ff
Added new keys '--user' in v1.shell to quota-show, quota-update.
Added command quota-delete, that provides ability for admins
to be able to delete a non-default quota (absolute limit) for a tenant
or user, so that tenant's quota will revert back to the configured default.
Added 'responce_key' parameter to Manager._update function
Added '--force' parameter to quota-update to support new functionality
on server
Fixes help output, when in 'manila help' was displayed only first
string of command documentation
Implement bp: user-quota-support
Change-Id: Ibfe9ccf83ea43d5af6652342f1fe6a88c78a0364