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
This commit is contained in:
Sloane Hertel 2017-06-29 08:47:05 -04:00 committed by Will Thames
parent 0154f32fbd
commit 338bf0fd3f

View file

@ -100,7 +100,7 @@ except ImportError:
def get_dhcp_options_info(dhcp_option): def get_dhcp_options_info(dhcp_option):
dhcp_option_info = {'DhcpOptionsId': dhcp_option['DhcpOptionsId'], dhcp_option_info = {'DhcpOptionsId': dhcp_option['DhcpOptionsId'],
'DhcpConfigurations': dhcp_option['DhcpConfigurations'], '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 return dhcp_option_info