1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes #38085 - cloudfront_invalidation doesn't work for the first invalidation ever (#38086)

This commit is contained in:
Gennady Aleksandrov 2018-04-03 03:14:09 +03:00 committed by Will Thames
parent 2d90f50eeb
commit 67cd641c04

View file

@ -181,7 +181,7 @@ class CloudFrontInvalidationServiceManager(object):
# find all invalidations for the distribution # find all invalidations for the distribution
try: try:
paginator = self.client.get_paginator('list_invalidations') paginator = self.client.get_paginator('list_invalidations')
invalidations = paginator.paginate(DistributionId=distribution_id).build_full_result()['InvalidationList'].get('Items', []) invalidations = paginator.paginate(DistributionId=distribution_id).build_full_result().get('InvalidationList', {}).get('Items', [])
invalidation_ids = [inv['Id'] for inv in invalidations] invalidation_ids = [inv['Id'] for inv in invalidations]
except (BotoCoreError, ClientError) as e: except (BotoCoreError, ClientError) as e:
self.module.fail_json_aws(e, msg="Error listing CloudFront invalidations.") self.module.fail_json_aws(e, msg="Error listing CloudFront invalidations.")