From b2f670acf6d373b18bde797c755891bdf3c8406c Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Wed, 10 Jan 2018 16:48:04 +0100 Subject: [PATCH] Add error checking for AMI finder script --- prepare-vms/lib/commands.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prepare-vms/lib/commands.sh b/prepare-vms/lib/commands.sh index 8a4248c4..872c4999 100644 --- a/prepare-vms/lib/commands.sh +++ b/prepare-vms/lib/commands.sh @@ -280,6 +280,9 @@ _cmd_start() { key_name=$(sync_keys) AMI=$(_cmd_ami) # Retrieve the AWS image ID + if [ -z "$AMI" ]; then + die "I could not find which AMI to use in this region. Try another region?" + fi TOKEN=$(get_token) # generate a timestamp token for this batch of VMs AWS_KEY_NAME=$(make_key_name)