Conditionally try to get ebs_optimized parameter from instance
This commit is contained in:
parent
38c29e1fff
commit
1c3a654912
1 changed files with 6 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue