From 5e40a5bfc1bc1b48d86547c13643c4f08e0fc764 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 14 Mar 2019 15:54:19 -0700 Subject: [PATCH] Block until instances are confirmed to be deleted --- net/gce.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/gce.sh b/net/gce.sh index f4c31850fc..dad8d68845 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -391,6 +391,14 @@ delete() { echo "No instances found matching '$filter'" else cloud_DeleteInstances true + while true; do + cloud_FindInstances "$filter" + if [[ ${#instances[@]} -eq 0 ]]; then + break; + fi + echo "(waiting for instances to be deleted)" + sleep 3 + done fi done rm -f "$configFile"