From 8a9405a55bc5ac814b6e952acd2df0a6467e8a27 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 --- cloud/amazon/ec2_lc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cloud/amazon/ec2_lc.py b/cloud/amazon/ec2_lc.py index 0721b4e203d..179ef14d70f 100644 --- a/cloud/amazon/ec2_lc.py +++ b/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)