Conditionally try to get ebs_optimized parameter from instance

reviewable/pr18780/r1
James Cammarata 11 years ago
parent 79c948e73d
commit 649cd5838c

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

Loading…
Cancel
Save