Browse Source

Fix encoding/decoding in paging of universal describer class

Change-Id: If568ce59c5adfbc8d7a47efdb82fcfb2d427f271
(cherry picked from commit 2b8bab7707)
changes/96/746596/1
Dmitry_Eremeev 7 months ago
committed by Andrey Pavlov
parent
commit
33f4244544
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      ec2api/api/common.py

+ 3
- 2
ec2api/api/common.py 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


Loading…
Cancel
Save