1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Conditionally try to get ebs_optimized parameter from instance

This commit is contained in:
James Cammarata 2014-06-20 14:26:21 -05:00
parent 38c29e1fff
commit 1c3a654912

View file

@ -570,13 +570,17 @@ def get_instance_info(inst):
'root_device_type': inst.root_device_type,
'root_device_name': inst.root_device_name,
'state': inst.state,
'hypervisor': inst.hypervisor,
'ebs_optimized': inst.ebs_optimized}
'hypervisor': inst.hypervisor}
try:
instance_info['virtualization_type'] = getattr(inst,'virtualization_type')
except AttributeError:
instance_info['virtualization_type'] = None
try:
instance_info['ebs_optimized'] = getattr(inst, 'ebs_optimized')
except AttributeError:
instance_info['ebs_optimized'] = False
return instance_info
def boto_supports_associate_public_ip_address(ec2):