Merge "encode the url parameters"
This commit is contained in:
commit
8b33427d1a
@ -16,6 +16,7 @@
|
||||
"""
|
||||
Fping interface.
|
||||
"""
|
||||
from six.moves import urllib
|
||||
|
||||
from novaclient import base
|
||||
|
||||
@ -41,14 +42,14 @@ class FpingManager(base.ManagerWithFind):
|
||||
exclude = exclude or []
|
||||
params = []
|
||||
if all_tenants:
|
||||
params.append("all_tenants=1")
|
||||
params.append(("all_tenants", 1))
|
||||
if include:
|
||||
params.append("include=%s" % ",".join(include))
|
||||
params.append(("include", ",".join(include)))
|
||||
elif exclude:
|
||||
params.append("exclude=%s" % ",".join(exclude))
|
||||
params.append(("exclude", ",".join(exclude)))
|
||||
uri = "/os-fping"
|
||||
if params:
|
||||
uri = "%s?%s" % (uri, "&".join(params))
|
||||
uri = "%s?%s" % (uri, urllib.parse.urlencode(params))
|
||||
return self._list(uri, "servers")
|
||||
|
||||
def get(self, server):
|
||||
|
@ -16,6 +16,8 @@
|
||||
"""
|
||||
service interface
|
||||
"""
|
||||
from six.moves import urllib
|
||||
|
||||
from novaclient import api_versions
|
||||
from novaclient import base
|
||||
|
||||
@ -42,11 +44,11 @@ class ServiceManager(base.ManagerWithFind):
|
||||
url = "/os-services"
|
||||
filters = []
|
||||
if host:
|
||||
filters.append("host=%s" % host)
|
||||
filters.append(("host", host))
|
||||
if binary:
|
||||
filters.append("binary=%s" % binary)
|
||||
filters.append(("binary", binary))
|
||||
if filters:
|
||||
url = "%s?%s" % (url, "&".join(filters))
|
||||
url = "%s?%s" % (url, urllib.parse.urlencode(filters))
|
||||
return self._list(url, "services")
|
||||
|
||||
@api_versions.wraps("2.0", "2.10")
|
||||
|
Loading…
Reference in New Issue
Block a user