28 Commits

Author SHA1 Message Date
Goutham Pacha Ravi
80ec2919ca Stop encoding "~" in query parameters
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.

Manila's API accepts "~" in both, its encoded
or un-encoded forms. So, let's stop encoding it
within manilaclient, regardless of the version
of python running it.

[1] https://tools.ietf.org/html/rfc3986.html
[2] https://docs.python.org/3/library/urllib.parse.html#url-quoting

Closes-Bug: #1785283
Change-Id: I6df5d543ae94ed1fa966c8019a52e9fca19e387e
2018-10-08 17:15:33 -07:00
Zuul
66bb56bd86 Merge "Fix 'List' command filters do not accept unicode symbols" 2018-03-21 18:19:10 +00:00
lijunbo
0cee351ed3 Fix 'List' command filters do not accept unicode symbols
When using the name or description to filter the share group list,
if the name or description is unicode symbols, the query will fail
due to the invalid str value. This change is to fix this.

PS: this bug is left from [1]
[1] I73ed2b675542d3aeedc9efdba08067819bf7d3e4

Change-Id: I14db19fb87da5cac86ec3634ddde6d647999db96
Closes-bug: #1712988
2018-02-24 10:11:15 +00:00
Zuul
8ff56c8d95 Merge "Add 'count' in list command" 2018-01-24 22:10:48 +00:00
zhongjun
6e8b3deef9 Add 'count' in list command
Add 'count' parameter in list share command.

Change-Id: I2b7b41b3579c24703a1a67ab5dc6f920a3ccbdc3
Partial-Implements: bp add-amount-info-in-list-api
2018-01-22 02:25:10 +00:00
Jiao Pengju
7e4a376426 Add search_opts in func list of ManagerWithFind type classes
In patch I96339778fa69c379863078250d5dfa7172f2c1b2, it called
self.list with search_opts, but some subclasses of ManagerWithFind
do not have search_opts in function list, this make some list
functions and show by name functions fail and throw 'unexpected
keyword argument search_opts' error. This patch will fix it.

Change-Id: Ic4b65c0e5900a0e3e19155d5d9d42d5063c3137d
Closes-Bug: #1738917
Closes-Bug: #1738918
2017-12-22 11:16:59 +08:00
Jiao Pengju
b9ebff14ca Fix share can not be found by name in admin context
Currently, when using admin context to execute 'manila
show <share-name>' to show a share detail which is not
owned by admin, it always fails with 'No share with a
name or ID of <share-name> exists'. This patch will fix
it.

Change-Id: I96339778fa69c379863078250d5dfa7172f2c1b2
Closes-Bug: #1721787
2017-12-19 17:06:24 +00:00
Clinton Knight
b4250866ea Add share group support to Manila client
Manila needs a grouping construct that, like shares, is a 1st-class
atomic data type. Our experience with CGs has demonstrated the
complexity of adding a grouping capability, yet there are other use
cases such as migration, replication, and backup in which some
storage controllers could only offer such features on share groups.
CGs also highlighted the poor optics of an advanced feature with
comparatively little potential for vendor support. And adding new
grouping constructs for each new feature is not technically
feasible. All of the above may be addressed by generic groups,
which we think is a clean extension to the original architecture of
Manila.

Implements: blueprint manila-share-groups
Change-Id: I8e29baed62355fc31caeec9c7a66eaebfcbdf184
2017-01-24 18:16:42 +02:00
ChangBo Guo(gcb)
c8bb1a2755 Remove copy of incubated Oslo code
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
2016-09-28 10:06:45 +08:00
dineshbhor
093a2e69f6 Replace OpenStack LLC with OpenStack Foundation
TrivialFix
Change-Id: I336952baacf55e36ad0a56ac98b95977fc0d593a
Closes-Bug: #1214176
2016-07-26 12:21:45 +00:00
Valeriy Ponomaryov
8c2f3c3a9b Define experimental API header on python client level instead of CLI
For the moment we cannot use experimental APIs using "python" client.
It is possible only if we use shell client (CLI).
It means, we cannot use "share replication", "share migration" and
"consistency groups" APIs of python manilaclient from other apps
such as Manila UI. So, add special experimental header on python
client level instead of CLI.

Change-Id: I6eed5dcfd1cb309817e083856b40e10cc6f970f6
Closes-Bug: #1599586
2016-07-13 18:42:39 +03:00
Thomas Bechtold
9a362ff188 Add uppercase env var names for consistency
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
2016-01-18 13:27:46 +01: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
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
vponomaryov
4a7e7cf089 Cleanup manilaclient.utils module (part 2)
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
2014-08-04 11:06:28 -04:00
Valeriy Ponomaryov
1cc313e5cf Use Resource class from common code
Replace own implementation of 'Resource' class with
same one from common apiclient code.

Partially implements: blueprint use-common-code

Change-Id: I87ac06931a23721fc8cc2d58b5a9473618073f32
2014-08-04 05:26:28 -04:00
Valeriy Ponomaryov
2b48b35c68 Use getid func from common code
Delete own implementation of 'getid' func and
use same one from common apiclient code.

Partially implements: blueprint use-common-code

Change-Id: I833def921aaf105740e429453ee6b017012e7303
2014-07-21 13:58:41 +00: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
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
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
07ee1bcb0c Code cleanup: use oslo's to_slug() instead of slugify()
The bash completion code is the sole user of the slugify() function
in utils, which is substantially similar to to_slug() provided in
strutils from oslo. Remove slugify() and use to_slug() instead.

Change-Id: Iffab2f59504ee7ec6528860e06a5140ff22f332f
Closes-Bug: #1266127
2014-06-18 05:22:24 -04:00
Yulia Portnova
00ccdd3831 Added detail parameter to list methods
Added detail parameter to list methods for security_services
and share_networks in v1.
Closes-bug #1297824

Change-Id: Iac2384bbf69c18f75291cc58509e8e99d0ac93ff
2014-04-01 14:58:01 +03:00
Shane Wang
af7cfcf34a Fix misspellings in python manilaclient
Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: I4dc676e82052ac49b2021431ec03bcb6f7c9758e
Closes-Bug: #1257295
2014-02-07 13:38:16 +08:00
Andrei V. Ostapenko
e5562354e4 Added support of per-tenant-user quotas
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
2013-10-17 17:31:21 +03: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