Skip to content

Commit

Permalink
updated the error messages on bogus ami_id
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Gupta <nikhilgupta2102@gmail.com>
  • Loading branch information
nikhil2611 committed Jun 23, 2021
1 parent 4b1eb1c commit ccc367b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kitchen/driver/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ccc367b

Please # to comment.