26 Commits

Author SHA1 Message Date
dineshbhor
093a2e69f6 Replace OpenStack LLC with OpenStack Foundation
TrivialFix
Change-Id: I336952baacf55e36ad0a56ac98b95977fc0d593a
Closes-Bug: #1214176
2016-07-26 12:21:45 +00:00
mark.sturdevant
f840c6f4d8 Client fix for api_version in positional and kwarg
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
2015-12-17 12:32:41 -08:00
Valeriy Ponomaryov
d4ff416e2d Fix client backwards compatibility
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
2015-11-20 13:29:01 +02:00
cFouts
c34e3b7d2c Nova Style API Version Support for Client
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
2015-11-16 19:03:55 +00:00
cFouts
3cd57eb32e Fix client API version to support Manila API
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
2015-09-14 01:07:07 +00:00
cFouts
36384fa190 Manila REST API Microversion Support for Client
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
2015-09-01 21:01:18 +00:00
Doug Hellmann
25d9af18bc Drop use of 'oslo' namespace package
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
2015-05-06 19:35:22 +00:00
Igor Malinovskiy
58cc003661 Add keystone-session support
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
2015-02-23 11:51:27 +02:00
Thomas Bechtold
863b41053f Use six.moves.urllib.parse for py2/3 compat
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
2014-12-28 11:00:29 +01:00
Andreas Jaeger
ca870810c9 Use oslo.utils
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
2014-10-23 08:13:25 +02:00
Andreas Jaeger
f09486f6b3 Use oslo.serialization
jsonutils from oslo-incubator is deprecated, replace it with
oslo.serialization.

Change-Id: I34af54bcb55eb0e1be3b74ea266b5da8bc5dc47d
Closes-Bug: #1383165
2014-10-23 08:13:19 +02:00
vponomaryov
b11f5d78a2 Cleanup manilaclient.utils module (part 1)
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
2014-08-04 10:52:10 -04:00
Valeriy Ponomaryov
73e29db968 Reuse exceptions from common apiclient code
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
2014-07-15 09:28:17 +03:00
vponomaryov
8f11b0bc62 Update requirements and fix pep issues after it
sync requirements with requirements project:
https://github.com/openstack/requirements/blob/master/global-requirements.txt

With update of hacking dependency fixed pep issues,
appeared with new version.

Change-Id: I90bd1a2b62161a8df40a7ce935c36f3f358924c7
2014-07-10 16:38:42 +03:00
vponomaryov
bd9c27914b Fix and enable H102 pep8 rule (apache license header)
Related-Bug: #1333290

Change-Id: I8c8794b06c604be36e632308e8c8c85aed6065ec
2014-07-10 09:25:04 +00:00
Julia Varlamova
02fb7a62d1 Add an ability to cache auth token
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
2014-07-07 17:22:28 +04:00
vponomaryov
0ccdb38dd2 Remove py33 incompatibilities
Except py33 compatibility changes were added unittests
to cover changed code.

Partially-implements blueprint py3-compatibility
Change-Id: Ib51e02ec69100a842ea1092e9f659ab1ebede671
2014-06-28 06:09:55 +00:00
Valeriy Ponomaryov
dc1926e9ad Enable H23* rules in pep/flake (py3-compat)
Basic python 3 compatibility fixies

Change-Id: I97726d42706c538d40cb1662112e56c13432e87f
Related-Bug: #1333290
2014-06-28 06:07:02 +00:00
Valeriy Ponomaryov
493ec0a538 Enable H30* rules in pep/flake
Second part of pep/flake fixies, that enables H30* group of rules.

Change-Id: Ib481887a37633a72dd5691c716b9214900a9384b
Related-Bug: #1333290
2014-06-28 06:06:50 +00:00
Valeriy Ponomaryov
b87c55d5fc Enable H40* rules in pep/flake
First part of pep/flake fixies, that enables H40* group of rules.

Change-Id: Ia85b49645b3bf634e99877855e6b31a404331b7f
Related-Bug: #1333290
2014-06-28 08:48:32 +03:00
Valeriy Ponomaryov
efd072b45d Replace json with jsonutils from common code
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
2014-06-18 04:35:45 -04:00
Andrei V. Ostapenko
bcb5ba08a2 Fixes using quota-show with default tenant id
Closes-Bug: #1234182
Change-Id: I0ce502e96693c9892dea87988f9435dd522ddcc1
2013-10-09 16:48:58 +03:00
vik
041bfa455c cleaned client with fixed tests. no quotas functionality implemented 2013-09-10 03:26:11 -04:00
Yulia Portnova
77dffa2c99 mass replace cinder to manila 2013-09-05 13:32:38 +03:00
Yulia Portnova
fa125b7714 setup.py fixed 2013-09-03 14:37:34 +03:00
Yulia Portnova
7c1a8bcbef cinderclient to manilaclient 2013-09-03 14:28:38 +03:00