From da047eec59e8e8f0555053d850ae2b7bfb2ef8ab Mon Sep 17 00:00:00 2001 From: Denis Afonso Date: Fri, 19 Jul 2019 06:21:54 +0100 Subject: [PATCH] cloudformation_facts: Fixes PhysicalResourceId KeyError(#55990) Fixes: #38033 --- lib/ansible/modules/cloud/amazon/cloudformation_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation_facts.py b/lib/ansible/modules/cloud/amazon/cloudformation_facts.py index a75fa9e6394..8d96d21959f 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation_facts.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation_facts.py @@ -256,7 +256,7 @@ class CloudFormationServiceManager: def to_dict(items, key, value): ''' Transforms a list of items to a Key/Value dictionary ''' if items: - return dict(zip([i[key] for i in items], [i[value] for i in items])) + return dict(zip([i.get(key) for i in items], [i.get(value) for i in items])) else: return dict()