diff options
author | Goutham Pacha Ravi <gouthampravi@gmail.com> | 2018-09-13 16:45:45 -0600 |
---|---|---|
committer | Goutham Pacha Ravi <gouthampravi@gmail.com> | 2018-09-13 18:51:17 -0600 |
commit | 223d754f6162d87a305bcb2b041a5e73d5fae303 (patch) | |
tree | 1ae69c10a7a1ad456ba31c7e5d1324c70666990a /cinderclient/v2 | |
parent | 64b2d5d83b384da1eddecdd4be31b61220080752 (diff) | |
download | python-cinderclient-223d754f6162d87a305bcb2b041a5e73d5fae303.tar.gz |
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
Diffstat (limited to 'cinderclient/v2')
-rw-r--r-- | cinderclient/v2/limits.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cinderclient/v2/limits.py b/cinderclient/v2/limits.py index 80c5bf9..dd1666d 100644 --- a/cinderclient/v2/limits.py +++ b/cinderclient/v2/limits.py @@ -14,9 +14,8 @@ # limitations under the License. """Limits interface (v2 extension)""" -from six.moves.urllib import parse - from cinderclient import base +from cinderclient import utils class Limits(base.Resource): @@ -95,6 +94,6 @@ class LimitsManager(base.Manager): if tenant_id: opts['tenant_id'] = tenant_id - query_string = "?%s" % parse.urlencode(opts) if opts else "" + query_string = utils.build_query_param(opts) return self._get("/limits%s" % query_string, "limits") |