1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make it easier to determine whether instance creation or tagging fails

This commit is contained in:
willthames 2014-02-17 13:05:28 +10:00
parent 372ae072fd
commit 4a093a9709

View file

@ -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 = []