From ccc367bade2eb34303a66a4bf295bfee8b201f28 Mon Sep 17 00:00:00 2001 From: Nikhil Gupta Date: Wed, 23 Jun 2021 16:41:16 +0530 Subject: [PATCH] updated the error messages on bogus ami_id Signed-off-by: Nikhil Gupta --- lib/kitchen/driver/ec2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kitchen/driver/ec2.rb b/lib/kitchen/driver/ec2.rb index 64fdc5a7..75fd7d4b 100644 --- a/lib/kitchen/driver/ec2.rb +++ b/lib/kitchen/driver/ec2.rb @@ -262,11 +262,11 @@ def create(state) instance.transport.connection(state).wait_until_ready create_ec2_json(state) if /chef/i.match?(instance.provisioner.name) debug("ec2:create '#{state[:hostname]}'") - rescue Exception + rescue Exception => e # Clean up any auto-created security groups or keys on the way out. delete_security_group(state) delete_key(state) - raise + raise "#{e.message} in the specified region #{config[:region]}. Please check this AMI is available in this region." end def destroy(state)