From 1b42fe2306b18996f53e5d987d7c5d106a7325f3 Mon Sep 17 00:00:00 2001 From: dongwenjuan Date: Thu, 16 Jun 2016 17:30:41 +0800 Subject: Before deleting the instance, check if the instance exists The instance may not exist if there is a error before creating instance or it failed to create, run the `cleanup` to delete the non-existent instance will raise an error Change-Id: I13e4b63be952967605093a4427f5b0ac4be280c3 Signed-off-by: dongwenjuan --- tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run.sh b/tests/run.sh index 241d6898..a2656aae 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -226,7 +226,7 @@ cleanup() { python ./nova_force_down.py "$COMPUTE_HOST" --unset sleep 1 - nova delete "$VM_NAME" + nova list | grep -q " $VM_NAME " && nova delete "$VM_NAME" sleep 1 alarm_id=$(ceilometer alarm-list | grep " $ALARM_NAME " | awk '{print $2}') sleep 1 -- cgit 1.2.3-korg