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

reviewable/pr18780/r1
Toshio Kuratomi 10 years ago
parent 8ed415589a
commit 31cc5f543f

@ -593,7 +593,8 @@ def get_instance_info(inst):
'state': inst.state, 'state': inst.state,
'hypervisor': inst.hypervisor, 'hypervisor': inst.hypervisor,
'tags': inst.tags, '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: try:
instance_info['virtualization_type'] = getattr(inst,'virtualization_type') instance_info['virtualization_type'] = getattr(inst,'virtualization_type')
except AttributeError: except AttributeError:

Loading…
Cancel
Save