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:
Sloane Hertel 2018-07-16 20:26:48 -04:00 committed by Matt Clay
parent f5053506d9
commit c40b85d01f
2 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- Allow more than one page of results by using the right pagination indicator ('NextMarker' instead of 'NextToken').

View file

@ -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):