From a96261a391abf21a00581bd74c3fb9b17af93492 Mon Sep 17 00:00:00 2001 From: "Ryan S. Brown" Date: Tue, 6 Sep 2016 17:15:13 -0400 Subject: [PATCH] Normalize variable naming in cloudformation_facts module using camel2snake --- .../modules/extras/cloud/amazon/cloudformation_facts.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/amazon/cloudformation_facts.py b/lib/ansible/modules/extras/cloud/amazon/cloudformation_facts.py index 028b2edec7b..381e479fe6f 100644 --- a/lib/ansible/modules/extras/cloud/amazon/cloudformation_facts.py +++ b/lib/ansible/modules/extras/cloud/amazon/cloudformation_facts.py @@ -254,8 +254,13 @@ def main(): # Create stack output and stack parameter dictionaries if facts['stack_description']: - facts['stack_outputs'] = to_dict(facts['stack_description'].get('Outputs'), 'OutputKey', 'OutputValue') - facts['stack_parameters'] = to_dict(facts['stack_description'].get('Parameters'), 'ParameterKey', 'ParameterValue') + facts['stack_outputs'] = to_dict(facts['stack_description'].get('Outputs'), 'OutputKey', 'OutputValue') + facts['stack_parameters'] = to_dict(facts['stack_description'].get('Parameters'), 'ParameterKey', 'ParameterValue') + + # normalize stack description API output + facts['stack_description'] = camel_dict_to_snake_dict(facts['stack_description']) + # camel2snake doesn't handle NotificationARNs properly, so let's fix that + facts['stack_description']['notification_arns'] = facts['stack_description'].pop('notification_ar_ns', []) # Create optional stack outputs all_facts = module.params.get('all_facts')