From 338bf0fd3fe3be73c0a58265222a0738f923ff5d Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Thu, 29 Jun 2017 08:47:05 -0400 Subject: [PATCH] ec2_vpc_dhcp_options_facts: if tags don't exist set them to default list instead of crashing - fixes #23825 (#23967) * if tags don't exist set them to an empty list * dhcp_option will always have a name tag * make requested change --- lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py index 143c6f45076..96f166c2b65 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options_facts.py @@ -100,7 +100,7 @@ except ImportError: def get_dhcp_options_info(dhcp_option): dhcp_option_info = {'DhcpOptionsId': dhcp_option['DhcpOptionsId'], 'DhcpConfigurations': dhcp_option['DhcpConfigurations'], - 'Tags': boto3_tag_list_to_ansible_dict(dhcp_option['Tags'])} + 'Tags': boto3_tag_list_to_ansible_dict(dhcp_option.get('Tags', [{'Value': '', 'Key': 'Name'}]))} return dhcp_option_info