Merge "align the order of parameters for urlencode()"

This commit is contained in:
Jenkins
2013-10-23 18:52:48 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 3 deletions

View File

@@ -251,9 +251,9 @@ class StackManagerPaginationTest(testtools.TestCase):
offset = result[0]
url = '/stacks?'
if offset > 0:
url += 'marker=abcd1234-%s&' % offset
url += 'limit=%s' % self.page_size
if offset > 0:
url += '&marker=abcd1234-%s' % offset
self.assertEqual(url, arg_url)
def results():

View File

@@ -72,7 +72,8 @@ class StackManager(base.Manager):
absolute_limit = kwargs.get('limit')
def paginate(qp, seen=0):
url = '/stacks?%s' % urlutils.urlencode(qp)
sort_qp = sorted(qp.items(), key=lambda x: x[0])
url = '/stacks?%s' % urlutils.urlencode(sort_qp)
stacks = self._list(url, "stacks")
for stack in stacks: