From 7cf0626d7b9176f0eba3ff83c69c5b4553ae3f7e Mon Sep 17 00:00:00 2001 From: Stefan Horning Date: Tue, 30 Apr 2019 21:28:56 +0200 Subject: [PATCH] Fixe cloudfront_distribution module issue #45043 (#49434) --- .../modules/cloud/amazon/cloudfront_distribution.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudfront_distribution.py b/lib/ansible/modules/cloud/amazon/cloudfront_distribution.py index e770b6f0bb3..d51351a6225 100644 --- a/lib/ansible/modules/cloud/amazon/cloudfront_distribution.py +++ b/lib/ansible/modules/cloud/amazon/cloudfront_distribution.py @@ -1761,12 +1761,11 @@ class CloudFrontValidationManager(object): distribution_config_name = 'DistributionConfig' distribution_ids = [dist.get('Id') for dist in distributions] for distribution_id in distribution_ids: - config = self.__cloudfront_facts_mgr.get_distribution(distribution_id) - distribution = config.get(distribution_name) + distribution = self.__cloudfront_facts_mgr.get_distribution(distribution_id) if distribution is not None: - distribution_config = distribution.get(distribution_config_name) + distribution_config = distribution[distribution_name].get(distribution_config_name) if distribution_config is not None and distribution_config.get('CallerReference') == caller_reference: - distribution['DistributionConfig'] = distribution_config + distribution[distribution_name][distribution_config_name] = distribution_config return distribution except Exception as e: