diff --git a/heatclient/tests/test_stacks.py b/heatclient/tests/test_stacks.py index b671a72b..6216068d 100644 --- a/heatclient/tests/test_stacks.py +++ b/heatclient/tests/test_stacks.py @@ -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(): diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index c196e235..06874bcf 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -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: