From c9b33d5de289ddf2fece65a108b8f057d76d0b41 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 11 Mar 2015 19:07:55 -0700 Subject: [PATCH] Fix for py2.6 (no dict comprehensions on py2.6) --- lib/ansible/modules/cloud/amazon/ec2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index 5fb17255a0e..10791439556 100755 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -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: