9 Commits

Author SHA1 Message Date
Zuul
4e17e1d191 Merge "Fix encoding of query parameters" 2018-10-03 17:54:19 +00:00
Goutham Pacha Ravi
223d754f61 Fix encoding of 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.

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
2018-09-13 18:51:17 -06:00
zhubx007
42b598d109 refactor the getid method base.py
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
2018-08-08 10:55:44 +08:00
Michael Dovgal
d8a6210152 Fix adding non-ascii attrs to Resource objects error
Due to these lines of code [0] we don't have an opportunity
to add attributes with non-ascii symbols to Resource objects,
but information about it will be in _info dict.

Example of side effect - quota_show command.
Because we don't have such an attr, here [1] it will be added
None value instead of real value [2].

This patch fixes this problem.

[0] - f8c93ed03b/cinderclient/apiclient/base.py (L498-L499)
[1] - f8c93ed03b/cinderclient/shell_utils.py (L179)
[2] - http://paste.openstack.org/show/593358/

Change-Id: I0493845dafc5dad836e899b9c22d563023c1dab0
Closes-Bug: #1652605
2017-01-20 20:12:29 +00:00
Jenkins
4eb63b8ef2 Merge "Minor refactoring for nested try-block" 2016-12-23 18:59:17 +00:00
xianming mao
8a4f61a93d Replace six.iteritems(iter) with iter.items()
As mentioned in [1], we should avoid using six.iteritems(iter) to
achieve iterators. We can use iter.items() instead, as it will
return iterators in PY3 as well.

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ic41abf2ca6ec3ecb651b980091b52d0a185c9089
2016-12-01 20:24:29 +08:00
Alexey Ovchinnikov
5d692deb7f Minor refactoring for nested try-block
A minor refactoring for unnecessary try-block nesting.

TrivialFix

Change-Id: I8bfb2ff10f802594769a53c9c90a47ae21af1f22
2016-11-23 15:20:34 +03:00
Rodion Tikunov
a94b56efca Fix typo in set unicode metadata key
Fixes typo in commit 0fd11f30f4a06f7b8cb701fa476aae4f193ac963

Change-Id: I50c59b92f6f65f7b6aa23fd530f6c4b105ad6b1d
Closes-Bug: #1622631
2016-11-16 14:03:36 +03:00
dineshbhor
a01a3e1b7f Move old oslo-incubator code out of openstack/common
As part of the first community-wide goal, teams were asked to
remove the openstack/common package of their projects if one
existed. This was a byproduct of the old oslo-incubator form
of syncing common functionality.

The package, apiclient, was moved to a top level location and
cliutils was moved to the common module. There are no oslo
specific libraries, the recommended solution is to move it in
tree and maintain it there.

Change-Id: Iee52004bd33c19d63133577ff466164b85fd6ca6
2016-11-03 18:29:31 +05:30