summaryrefslogtreecommitdiff
path: root/novaclient/utils.py
diff options
context:
space:
mode:
authorAndrey Volkov <avolkov@mirantis.com>2016-08-01 17:38:14 +0300
committerAndrey Volkov <avolkov@mirantis.com>2016-08-03 18:37:55 +0300
commit6bbcedb0001df2312cbf39ba8090e780f9e0c884 (patch)
tree4ab3f2b2e71255600cbefa47306a88a1c537fb8d /novaclient/utils.py
parent48da89e2a297e44125cb88aa284cf99bf87c2b1f (diff)
downloadpython-novaclient-6bbcedb0001df2312cbf39ba8090e780f9e0c884.tar.gz
Add support for microversion 2.33
This change allows novaclient to get several hypervisors with the help of new optional parameters 'limit' and 'marker' which were added to hipervisor-list command. Change-Id: Ib723fb1dc1cd57b6f796bb93e0dd8ddf2da4b2a0
Diffstat (limited to 'novaclient/utils.py')
-rw-r--r--novaclient/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/novaclient/utils.py b/novaclient/utils.py
index 0170c952..d7573758 100644
--- a/novaclient/utils.py
+++ b/novaclient/utils.py
@@ -24,6 +24,7 @@ from oslo_utils import encodeutils
import pkg_resources
import prettytable
import six
+from six.moves.urllib import parse
from novaclient import exceptions
from novaclient.i18n import _
@@ -465,3 +466,9 @@ def record_time(times, enabled, *args):
yield
end = time.time()
times.append((' '.join(args), start, end))
+
+
+def prepare_query_string(params):
+ """Convert dict params to query string"""
+ params = sorted(params.items(), key=lambda x: x[0])
+ return '?%s' % parse.urlencode(params) if params else ''