Added default value for when CloudFrontOriginAccessIdentityList is (#44984)

missing.

(cherry picked from commit 93cd050250)
pull/45404/merge
Jonathan 6 years ago committed by Matt Davis
parent 7aad590d3d
commit ad1c62d6dd

@ -0,0 +1,2 @@
bugfixes:
- cloudfront - fix bug when CloudFrontOriginAccessIdentityList is missing (https://github.com/ansible/ansible/pull/44984)

@ -93,7 +93,7 @@ class CloudFrontFactsServiceManager(object):
def list_origin_access_identities(self):
try:
paginator = self.client.get_paginator('list_cloud_front_origin_access_identities')
result = paginator.paginate().build_full_result()['CloudFrontOriginAccessIdentityList']
result = paginator.paginate().build_full_result().get('CloudFrontOriginAccessIdentityList', {})
return result.get('Items', [])
except botocore.exceptions.ClientError as e:
self.module.fail_json_aws(e, msg="Error listing cloud front origin access identities")

Loading…
Cancel
Save