From 10019c13b609754719f04d1b9dc730af818f048f Mon Sep 17 00:00:00 2001 From: willthames Date: Mon, 17 Feb 2014 13:05:28 +1000 Subject: [PATCH] Make it easier to determine whether instance creation or tagging fails --- cloud/ec2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/ec2 b/cloud/ec2 index e050611fcf8..f9d1a42813c 100644 --- a/cloud/ec2 +++ b/cloud/ec2 @@ -816,7 +816,7 @@ def create_instances(module, ec2, override_count=None): res = ec2.run_instances(**params) except boto.exception.BotoServerError, e: - module.fail_json(msg = "%s: %s" % (e.error_code, e.error_message)) + module.fail_json(msg = "Instance creation failed => %s: %s" % (e.error_code, e.error_message)) instids = [ i.id for i in res.instances ] while True: @@ -834,7 +834,7 @@ def create_instances(module, ec2, override_count=None): try: ec2.create_tags(instids, instance_tags) except boto.exception.EC2ResponseError, e: - module.fail_json(msg = "%s: %s" % (e.error_code, e.error_message)) + module.fail_json(msg = "Instance tagging failed => %s: %s" % (e.error_code, e.error_message)) # wait here until the instances are up this_res = []