Merge "Encode unicode filter arguments for server list"

changes/17/225417/1
Jenkins 7 years ago committed by Gerrit Code Review
commit 527df930be

@ -43,6 +43,12 @@ class ServersTest(utils.FixturedTestCase):
for s in sl:
self.assertIsInstance(s, servers.Server)
def test_filter_servers_unicode(self):
sl = self.cs.servers.list(search_opts={'name': u't€sting'})
self.assert_called('GET', '/servers/detail?name=t%E2%82%ACsting')
for s in sl:
self.assertIsInstance(s, servers.Server)
def test_list_all_servers(self):
# use marker just to identify this call in fixtures
sl = self.cs.servers.list(limit=-1, marker=1234)

@ -570,6 +570,8 @@ class ServerManager(base.BootingManagerWithFind):
for opt, val in six.iteritems(search_opts):
if val:
if isinstance(val, six.text_type):
val = val.encode('utf-8')
qparams[opt] = val
detail = ""

Loading…
Cancel
Save