Fix encoding/decoding in paging of universal describer class

Change-Id: If568ce59c5adfbc8d7a47efdb82fcfb2d427f271
(cherry picked from commit 2b8bab7707)
This commit is contained in:
Dmitry_Eremeev 2020-02-04 13:42:02 +00:00 committed by Andrey Pavlov
parent fb16aa422b
commit 33f4244544
1 changed files with 3 additions and 2 deletions

View File

@ -375,11 +375,12 @@ class UniversalDescriber(object):
next_item = 0
if next_token:
next_item = int(base64.b64decode(next_token))
next_item = int(base64.b64decode(next_token).decode())
if next_item:
formatted_items = formatted_items[next_item:]
if max_results and max_results < len(formatted_items):
self.next_token = base64.b64encode(str(next_item + max_results))
self.next_token = base64.b64encode(
str(next_item + max_results).encode())
formatted_items = formatted_items[:max_results]
return formatted_items