diff --git a/cloud/amazon/ec2_ami.py b/cloud/amazon/ec2_ami.py index f3caa587485..58ac76f3c93 100644 --- a/cloud/amazon/ec2_ami.py +++ b/cloud/amazon/ec2_ami.py @@ -377,7 +377,7 @@ def main(): try: ec2 = ec2_connect(module) except Exception, e: - module.json_fail(msg="Error while connecting to aws: %s" % str(e)) + module.fail_json(msg="Error while connecting to aws: %s" % str(e)) if module.params.get('state') == 'absent': if not module.params.get('image_id'):