From 103b1500901d02d4ce77d2ebed0e6fab4acade0b Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 27 Jul 2015 10:40:27 -0700 Subject: [PATCH] Convert object into dict so it will turn into json properly --- lib/ansible/modules/cloud/amazon/ec2_lc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_lc.py b/lib/ansible/modules/cloud/amazon/ec2_lc.py index 1a723c0c97f..a6aad6f381d 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_lc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_lc.py @@ -237,11 +237,14 @@ def create_launch_config(connection, module): changed = True except BotoServerError, e: module.fail_json(msg=str(e)) - result = launch_configs[0] + + result = dict( + ((a[0], a[1]) for a in vars(launch_configs[0]) if a[0] not in ('connection',))) module.exit_json(changed=changed, name=result.name, created_time=str(result.created_time), image_id=result.image_id, arn=result.launch_configuration_arn, - security_groups=result.security_groups, instance_type=result.instance_type, + security_groups=result.security_groups, + instance_type=result.instance_type, result=result)