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

Fix for py2.6 (no dict comprehensions on py2.6)

This commit is contained in:
Toshio Kuratomi 2015-03-11 19:07:55 -07:00 committed by Matt Clay
parent c9cc8d0b70
commit c9b33d5de2

View file

@ -593,7 +593,8 @@ def get_instance_info(inst):
'state': inst.state,
'hypervisor': inst.hypervisor,
'tags': inst.tags,
'groups': {group.id: group.name for group in inst.groups}}
'groups': dict((group.id, group.name) for group in inst.groups),
}
try:
instance_info['virtualization_type'] = getattr(inst,'virtualization_type')
except AttributeError: