]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: Retry generating SSH vagrant config. Also add some debug.
authorDavid Galloway <dgallowa@redhat.com>
Tue, 15 Jun 2021 20:17:19 +0000 (16:17 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Jun 2021 16:57:11 +0000 (18:57 +0200)
Signed-off-by: David Galloway <dgallowa@redhat.com>
tests/scripts/generate_ssh_config.sh

index 43e64a65477f93af9002715aeeb21d9f502905dc..feebaf676c2f8e1f3034c37159c446b4725e3169 100644 (file)
@@ -11,4 +11,22 @@ if [ $# -eq 0 ]
 fi
 
 cd "$path"
-vagrant ssh-config > vagrant_ssh_config
+
+# Let's print vagrant status for debug purposes and to give the VMs a second to
+# settle before asking vagrant for SSH config.
+vagrant status || true
+
+n=0
+until [ "$n" -ge 5 ]
+do
+  vagrant ssh-config > vagrant_ssh_config && break
+  n=$((n+1))
+  echo "\`vagrant ssh-config\` failed.  Retrying."
+  sleep 3
+done
+
+if [ "$n" -eq 5 ]; then
+  echo "\`vagrant ssh-config\` failed 5 times.  This is a fatal error."
+  cat vagrant_ssh_config
+  exit 1
+fi