Backport pagination fix for cloudfront_facts (#42746)
* Fix #38038 cloudfront_facts module returns only first page of response (#38045)
(cherry picked from commit 12057de1c6
)
* changelog
This commit is contained in:
parent
f5053506d9
commit
c40b85d01f
2 changed files with 9 additions and 2 deletions
3
changelogs/fragments/fix_pagination_cloudfront_facts.yml
Normal file
3
changelogs/fragments/fix_pagination_cloudfront_facts.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- Allow more than one page of results by using the right pagination indicator ('NextMarker' instead of 'NextToken').
|
|
@ -509,8 +509,12 @@ class CloudFrontServiceManager:
|
|||
else:
|
||||
result = response.get(result_key)
|
||||
results.update(result)
|
||||
args['NextToken'] = response.get('NextToken')
|
||||
loop = args['NextToken'] is not None
|
||||
args['Marker'] = response.get('NextMarker')
|
||||
for key in response.keys():
|
||||
if key.endswith('List'):
|
||||
args['Marker'] = response[key].get('NextMarker')
|
||||
break
|
||||
loop = args['Marker'] is not None
|
||||
return results
|
||||
|
||||
def keyed_list_helper(self, list_to_key):
|
||||
|
|
Loading…
Reference in a new issue